parent, showing a form
-
Hello, I have been developing a program. There are lots of forms, and I do need to show some of them(when they become necessary) I was using a method to show a form inside a picturebox. I have used the SetParent and GetParent apis to perform the operation that I wish in Visual Basic 6. I was able to show a form inside a picture box or frame. Show I can Load and Unload forms that I want. How can I do that in C#? Thank you for your time. Best Regards Emre YAZICI
-
Hello, I have been developing a program. There are lots of forms, and I do need to show some of them(when they become necessary) I was using a method to show a form inside a picturebox. I have used the SetParent and GetParent apis to perform the operation that I wish in Visual Basic 6. I was able to show a form inside a picture box or frame. Show I can Load and Unload forms that I want. How can I do that in C#? Thank you for your time. Best Regards Emre YAZICI
One easy way that allows tabbing to work properly and looks natural is to use UserControls for your forms and create them as needed. You would place a panel control on your form where you want the embedded form to show and in your code, you would create the user control you want displayed and add the control to the Panel's Controls collection. When you want to change to another UserControl, you can clear the Panel's Controls collection and add the new one. Another way is by using a tab control and convering the tabs. And yet another way is to set the form's border you wish to embed to nothing and the control box to nothing (last step many not be needed) and set the Form's TopLevel to false; You can then add it to the Panel's Control list and use a Show() on the form. This will however cause you tabbing problems. I never went further than this since the UserControl method above gave me all that I could desire. Rocky Moore <><