A very slight change of tack … I was going to dynamically work out how big to make the picture rectangles, and then add them all with the images that are in the folder. Very hard, looking at the algorithms out there on the internet. Maybe that’ll be saved for (another) rainy day.

In the meantime I can see for now that image boxes 160 wide by 270 high seem to be a-okay. (I should probably make that configurable and stored in a .exe.config at some point). So what I decided to do was (as a first step for fully dynamic loading) add N images to the form.

I also changed the AutoResize property on the form in design mode to TRUE. This means that if you try to add controls beyond the visible boundaries of the form, a scroll bar is automatically added. My code controls the width, so we shouldn’t ever end up with a horizontal scrollbar, so it should just be height.

I tested it with 8, and 38 as the number of images, and the scroll bar does correctly get added at the right time.

I’ll need to modify the function above to take as input the full path for a file that has been found in the folder that has been selected.. but largely it’s good to go. Just need to do the scanning code next.