Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is equivalent of container or shape in WinForm
Message
 
 
To
21/08/2009 00:12:08
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01419055
Message ID:
01419515
Views:
40
Bonnie,

Thank you for the explanation. Now I see that for me the most appropriate would be to use a UserControl. Let me explain. In my VFP app I almost never drop data entry controls (textbox, label, etc) on forms. Instead data entry controls are placed on containers. Then, in the INIT of the form, the container is dynamically "placed" (don't know the right word) on the form. This allows me to make customer changes for some customers as I can at run time (based on a certain setting) replaced a standard container with this customer specific (custom) container.

I don't know if the above type approach is doable in WinForms. That is, can I dynamically instantiate/assign a UserControl to a form?

>Dmitry,
>
>As Cetin says, you can use a Panel. As Kevin says, you can use a UserControl. In addition to those, it sounded to me like you also might be interested in using a GroupBox. All three of these controls have similarities, in that they're "containers", and you can visually drop stuff on them, but they are typically used for different purposes.
>
>UserControls are typically used as a "standalone" set of controls (IOW, you'd design a UserControl visually by dropping on TextBoxes, etc. and save it as a single class file, MyCustomerControl.cs for example).
>
>Panels are typically used for docking, along with Splitters, and are dropped on a Form or UserControl.
>
>GroupBoxes are typically used, as the name suggests, to visually group a set of controls together(TextBoxes,etc), and are dropped on a Form or UserControl.
>
>~~Bonnie
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform