logo       

Re: User v Custom Controls: msg#00345

windows.devel.dotnet.winforms

Subject: Re: User v Custom Controls

Richard Heintze schrieb:

How do I decide between user and custom controls?

User controls are derived from UserControl and thus inherit the
infrastructure to contain other controls (e.g. you can create a new user
control containing buttons, list views, etc, all with Designer support).
Custom controls inherit from Control and thus have no container facilities.

You normally use user controls if you want to create a new control as a
compound of other controls (i.e. like a form, but reusable), custom
controls if you create a new control from scratch, even drawing it
yourself in its OnPaint method.

I'm using managed C++ for a WinForms App and I'm
having trouble databinding an array list to a
combobox.

Where's the problem?

ArrayList __gc * l = new ArrayList();
l->Add(S"Test1");
l->Add(S"Test2");
l->Add(S"Test3");
comboBox1->DataSource = l;

I do know how to do this in VB.NET, however. Should I
use a usercontrol or a custom control for this?

What do you want to use the user control or custom control for?

Fabian



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise