create button on panel on panel at runtime
Posted on 2005-04-25
I would like to create a MainPanel on my form that will be filled with logical units represented by SubPanels which each of them contain a number of control elements like buttons etc.
The number of SubPanels will be by far too much for the MainPanel so I need scrolling function for the MainPanel.
How can I create these SubPanels at runtime in such a way, that automatically the MainPanel appears with horizontal scrollbar, as soon as it is populated with more SubPanels than the screenwidth can display?
How to logically assign the buttons etc. to the subpanels at runtime so that they "know", that they belong to the subpanel and in such a way that the subpanel "knows" that it belongs to the main panel?
I hope you can help me with that. Should not be too difficult for an expert, but it would really help me very much!