|
Re: User v Custom Controls: msg#00407windows.devel.dotnet.winforms
You don't lose anything, but it's possible that you'll gain things you don't want. If you plan to paint the entire surface of the control yourself in your custom control's OnPaint method, then the design time support won't be useful. (Indeed it will be confusing - it'll just show a blank grey area, because the Forms Designer doesn't call the OnPaint method for the control being edited at design time.) You might not want scrollability or the ContainerControl features. (And just to clarify, you don't need to derive from ContainerControl in order to support containment. ContainerControl is mainly about focus handling. Deriving from it can subtly change the behaviour of both focus handling and validation. The ability to act as a container of other controls comes from Control, not ContainerControl.) If you don't need these things, then you're paying for stuff you're not using, which may increase your program's working set unnecessarily. -- Ian Griffiths - DevelopMentor http://www.interact-sw.co.uk/iangblog/ > -----Original Message----- > From: Craig Larsen > > So what do you lose by using a user control instead of a custom control > ? > > Craig Larsen > larsenc@xxxxxxx > > > -----Original Message----- > From: Griffiths, Ian [mailto:igriffiths@xxxxxxxxxxx] > > Richard Heintze schrieb: > > > How do I decide between user and custom controls? > > Fabian Schmied replied: > > User controls are derived from UserControl and thus inherit the > > infrastructure to contain other controls > > But UserControl inherits *that* infrastructure from Control... So this > is doesn't really help you in deciding between a custom control and a > user control - custom control can contain other controls too. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Calling a WINFORM from another WINFORM: 00407, Griffiths, Ian |
|---|---|
| Next by Date: | Re: Calling a WINFORM from another WINFORM: 00407, Darren Swartzendruber |
| Previous by Thread: | Re: What is in Forms1.resX?i: 00407, Andy Schott |
| Next by Thread: | Re: Binding Combobox to ArrayList (was User v Custom Controls): 00407, Richard Heintze |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |