|
Re: User v Custom Controls: msg#00351windows.devel.dotnet.winforms
> > 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> |
|---|---|---|
| Previous by Date: | Re: Web Service accessing SqlServer WAS: SqlCo mmandBuilder: 00351, Block, Jeffrey A. (Jeff) |
|---|---|
| Next by Date: | Re: User v Custom Controls: 00351, Andy Schott |
| Previous by Thread: | Re: User v Custom Controlsi: 00351, Richard Heintze |
| Next by Thread: | Re: User v Custom Controls: 00351, Andy Schott |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |