|
-
Jan 12th, 2010, 10:44 PM
#1
Thread Starter
Junior Member
[RESOLVED] comboBox
hi does anyone know how to read an array from a dialog box?
i want to read the code below.. need help urgently pls... thnx...
Code:
Private Shared ReadOnly route As String() = { _
"Holland Circle", "Darbin", "Bugis", "Coronation Street", "Winnard", _
"Bridgetown", "Gorky", "Interimo", "Bishan", "Woodland Rise" _
}
-
Jan 12th, 2010, 10:45 PM
#2
Re: comboBox
I have no idea what you are asking. You want to display the contents of that array in a dialog?
-
Jan 12th, 2010, 10:48 PM
#3
Thread Starter
Junior Member
Re: comboBox
ooh.. sorry, i want that data in the array to appear in a dropdown list when i run the code..
so am asking for a way to do that
tnx..
-
Jan 12th, 2010, 10:54 PM
#4
Re: comboBox
Something along thesse lines:
Code:
Public Class Form1
Private Shared ReadOnly route As String() = { _
"Holland Circle", "Darbin", "Bugis", "Coronation Street", "Winnard", _
"Bridgetown", "Gorky", "Interimo", "Bishan", "Woodland Rise"}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ComboBox1.DataSource = route
End Sub
End Class
-
Jan 12th, 2010, 11:01 PM
#5
Thread Starter
Junior Member
Re: comboBox
this is what i have an its not working.. can u pls tell me what am doing wrong.
Code:
Private Shared ReadOnly route As String() = { _
"Holland Circle", "Darbin", "Bugis", "Coronation Street", "Winnard", _
"Bridgetown", "Gorky", "Interimo", "Bishan", "Woodland Rise" _
}
Private Sub oringinComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles oringinComboBox.SelectedIndexChanged
me.oringinComboBox.DataSource = route
End Sub
Private Sub destnComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles destnComboBox.SelectedIndexChanged
me.destnComboBox.DataSource = route
End Sub
-
Jan 12th, 2010, 11:04 PM
#6
Re: comboBox
Read your code.... You are reloading the combobox(s) every time you make a selection.
Re read my post - The Combo loads at Form_Load() - for example.
-
Jan 12th, 2010, 11:16 PM
#7
Thread Starter
Junior Member
Re: comboBox
tnx alot... i can now load it... but i have 2 comboBoxes that get there data from the array,
and they move together. i mean when i select an item in the first combo box, the other comboxbox automatically selects the same item i selected in the first comboBox, why is this? and how can i get it to select individually?
thank you so much, at list theres some light nw.. i've been struggling for it to show something a while now...
Code:
Private Shared ReadOnly route As String() = { _
"Holland Circle", "Darbin", "Bugis", "Coronation Street", "Winnard", _
"Bridgetown", "Gorky", "Interimo", "Bishan", "Woodland Rise" _
}
Private Sub frmArea1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.oringinComboBox.DataSource = route
Me.destnComboBox.DataSource = route
End Sub
-
Jan 13th, 2010, 12:04 AM
#8
Re: [RESOLVED] comboBox
Because when you assign the same array to 2 datasources they are bound together.
Change your formload code to have this, which will simply just load each combo with the string contents of your array.
Code:
Me.oringinComboBox.Items.AddRange(route)
Me.destnComboBox.Items.AddRange(route)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|