I'm having some dificulties programing a GUI with windows forms inside Visual Studio.
I wanted to know how can I change the content of a container... let's say I wave a split container on panel1 I have buttons and I want the GUI on panel to change accordingly to the buttons I press.
For example I press button SEARCH on panel1 --> panel2 presents me searching fields.
I press the button INFO --> panel2 a tab with options GLOBAL and DETAILED.
and so on...
Thank you very much I also came up to this ideia some minutes after I aked but once again what's the code to load usercontrols into for example "splitContainer1.Panel1"?? some code please if anyone can help thanks
Create a UserControl in the designer and rebuild your Project. Then your control should appear in your toolbox and you can drag it onto Panel2 like any other standard windows control. Use the Dock property to make it fill the Panel.
You can even make your UserControl fire your/it's own events which you make up, like OnSwitchPanel() etc, which can be handled by it's container (like when you handle a Button's OnClick event). UserControls also help to keep your application modular and more easy to maintain, as all related code is within the UserControl and not sprawled across the your Main Form. If you create a general UserControl it can be used in many of your Projects.
If you are just learning, don't be afraid to create a 'test' project' (or lots of them, they are easy to delete afterwards), no splitter, nothing complicated, just a form with a very simple UserControl you create. Play with it until you understand how they work. Once you understand, you will more quickly implement your real control in your real app. So you take a step back to move two steps forward. That's what I do and I suspect many others here do the same when looking at something new to them. Sorry if this last paragraph was patronising... Good Luck.
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......