logo       

Re: User v Custom Controls: msg#00351

windows.devel.dotnet.winforms

Subject: Re: User v Custom Controls

>
> Where's the problem?
>
> ArrayList __gc * l = new ArrayList();
> l->Add(S"Test1");
> l->Add(S"Test2");
> l->Add(S"Test3");
> comboBox1->DataSource = l;
>

Can someone help me translate this into C++? When I
tried, the combobox choked on the strings I gave it
for the value and display members.

Public Structure State
Private m_shortName, m_longName As String

Public Sub New(ByVal longName As String, ByVal
shortName As String)
Me.m_shortName = shortName
Me.m_longName = longName
End Sub

Public ReadOnly Property ShortName() As String
Get
Return m_shortName
End Get
End Property

Public ReadOnly Property LongName() As String
Get
Return m_longName
End Get
End Property
End Structure

Private States() As State = {New State("Alabama",
"AL"), ..., New State("Wyoming", "WY")}

comboBoxState.DataSource=States
comboBoxState.DisplayMember="LongName"





From
http://samples.gotdotnet.com/quickstart/aspplus/default.aspx?url=%2fquickstart%2fwinforms%2fdoc%2fWinFormsData.aspx


__________________________________
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