I am writing a program to display images through multiple PictureBoxes, and have decided that a tableLayoutPanel
is a good way to do this. I currently have a 50x50 grid. The aim is to fill every column and row with PictureBoxes
.
I also need to be able to resize this grid in future, so dragging and dropping pictureboxes isn't something I am able to do.
I have had a look for anyone trying to do the same thing, and have come across this but it was in C# and I am not good enough to translate it across.
I have attempted to do this, but I don't know how to start adding pictureboxes during runtime, and I suspect I am barking up the wrong methodical tree.
Dim tableSquareCollection = tableLayoutPanel1.Controls.OfType(Of TableLayoutPanel)() 'get collection of how many squares are in the table - this doesn't work, I can't find what datatype an empty square is
For i = 0 To tableSquareCollection.Count - 1
'Add picture boxes to each square - but I have no ideas at how to start this
Next
I understand this is a minimal attempt at my question, but I can't see any further of a way through to my aim.
Thank you.