c# - Resize PictureBox as resizing the form -
i'm loading multiple images panel (multiple pictureboxes inside panel) , resize images windows form resized.
here code:
foreach (string filename in ofdmulti.filenames){ picbox[i] = new picturebox(); picbox[i].size = new system.drawing.size(256, 256); picbox[i].sizemode = pictureboxsizemode.zoom; picbox[i].dock = dockstyle.fill; i++; } but don't see multiple images, 1 , stretched fully, may wrong?
you have multiple issues code. first off, line of code ensure see 1 picturebox...likely last 1 added:
picbox[i].dock = dockstyle.fill; second, don't see setting picturebox location, going point(0, 0), meaning overlap extent regardless of dock setting.
if trying nice arrangement, such tiled, use tablelayoutpanel. allow describe grid pattern rows , columns , add picturebox controls grid.
there other options, of course, depending upon goal.
Comments
Post a Comment