Displaying thumbnail icons 128x128 pixels or larger in a grid in ListView

后端 未结 5 646
栀梦
栀梦 2020-12-07 20:39

Original Question (see Update below)

I have a WinForms program that needs a decent scrollable icon control with large icons (128x128 or larger thumbnails, really)

5条回答
  •  猫巷女王i
    2020-12-07 21:12

    You could use the FlowLayoutPanel and drop pictureboxes in it. Set the picturebox to a size of 128x128 and the sizemode to 'zoom' (This takes care of resizing your image without loss of aspect ratio). You can even programatically add the pictureboxes.

    PictureBox pb = New Picturebox;
     pb.image = gcf.image128;
     FlowLayoutPanel1.Controls.Add(pb)
    

    Since you need to have a label under the picturebox, you could create a Usercontrol like Pastor said that all it has is a picturebox and a label under it. Then that would be the control instance you would add to your flowlayoutpanel.

提交回复
热议问题