Combobox problem

  • Thread starter Thread starter bert beat
  • Start date Start date
B

bert beat

hello

i got a little problem i hope someone can help me with it

my program

"Begin Program Code

dim MainArray() as string {"Array1","Array2"}
dim Array1() as string {"Array1Tes1","Array1Test2"}
dim Array2() as string {"Array2Tes1","Array2Test2"}

cboArrayloading.DataSource = MainArray

lstBox.DataSource = cboArrayLoading.SelectedItem

"End Program Code

(lst -> listbox)
(cbo -> combobox)

"How come that i get an error, i just want to load the data from
Array1 or Array2 (depending on which array i selected in my combobox)
in the listbox.

is there another way to do this?

I'm sure one of you can give me an answer to my suestion"
 
Hi Bert,

You haven't selected and item (selecteditem) in the combobox. You can try,
just as a test, 'cboarrayloading.selectedindex = 1'
before the code for lstbox.datasource.

HTH,

Bernie Yaeger

bert beat said:
hello

i got a little problem i hope someone can help me with it

my program

"Begin Program Code

dim MainArray() as string {"Array1","Array2"}
dim Array1() as string {"Array1Tes1","Array1Test2"}
dim Array2() as string {"Array2Tes1","Array2Test2"}

cboArrayloading.DataSource = MainArray

lstBox.DataSource = cboArrayLoading.SelectedItem

"End Program Code

(lst -> listbox)
(cbo -> combobox)

"How come that i get an error, i just want to load the data from
Array1 or Array2 (depending on which array i selected in my combobox)
in the listbox.

is there another way to do this?

I'm sure one of you can give me an answer to my suestion"
 
bert beat said:
i got a little problem i hope someone can help me with it

my program

"Begin Program Code

dim MainArray() as string {"Array1","Array2"}
dim Array1() as string {"Array1Tes1","Array1Test2"}
dim Array2() as string {"Array2Tes1","Array2Test2"}

cboArrayloading.DataSource = MainArray

lstBox.DataSource = cboArrayLoading.SelectedItem

Replace the line above with something like this:

\\\
Dim MainArray() As String = _
{"Array1", "Array2"}
cboArrayLoading.DataSource = MainArray
..
..
..
Dim Data()() As String = _
{ _
New String() {"Array1Test1", "Array1Test2"}, _
New String() {"Array2Test1", "Array2Test2"} _
}
lstBox.DataSource = Data(cboArrayLoading.SelectedIndex)
///
 
Back
Top