logo       

Re: User v Custom Controls: msg#00349

windows.devel.dotnet.winforms

Subject: Re: User v Custom Controls

I just wanted to have display members that were
different from the value members. I created a new
class like the VB example suggests where the display
members are "Alaska", "Washington"... and the value
members are "AK", "WA", ...

I tried to create the special class where the first
member was the display string and the second member
was the value member. I had to create some properties
to do this and the ValueMember and DisplayMember of
the combo box choked after accepting the strings.

Do you have an example of this in C++? Unfortunately,
I deleted mine (because it did not work).
Sieg

--- Fabian Schmied <fabian.schmied@xxxxxx> wrote:
> 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


__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools



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

News | FAQ | advertise