✅ Swap between multiple forms on a single panel
Im currently working on this project and ive designed it so that my main form has a panel and on top are buttons that should load different forms
If i open a form with a button when the panel is empty the form loads properly, no matter what form i open, but if a form is already loaded then it doesnt swap. Any ideas?
18 Replies
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
thats basically the 2 buttons that activate the forms on the panel(mainpanel)
when i press any button to load a form on the panel it loads normally, but i havent figured out a way to be able to swap between forms
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
ima be honest, im a beginner and this is the first way i found to make panels
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
i mean, it means add lol
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
the only thing i guess ive found is how to refresh the panel but when i load a different panel again it didnt work but its probably cause of the add thing?
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
yeah i just saw there is remove after panel.controls
lemme try
i mean i get the logic with the remove, but now ive run into not knowing how to get the name of the form created by the button
cause i cant do panel.controls.remove without a name
only way im currently thinking about this rn is to make 2 panels that load at start and the only thing the buttons do is hide and unhide the respective panels
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
nahh not really
ill try to create different panels and we'll see how it looks
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
ok so i tried this but when i overlap panels in the form design, every part of a panel that overlaps another panel hides aswell when i hide the panel i want gone
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
ehhh ill try smth maybe tommorow ive already been coding for like 10 hours today lol
thanks for the ideas and help anyway :peepohappy: