473,396 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Combobox problem

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"
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 21 '05 #1
2 958
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" <be********@hotmail-dot-com.no-spam.invalid> wrote in message
news:42********@127.0.0.1...
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"
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 21 '05 #2
"bert beat" <be********@hotmail-dot-com.no-spam.invalid> schrieb:
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)
///
"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.


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Chandra | last post by:
Hello Sir, This is Chandra and Working as Software Engineer. I got a really weird problem with ComboBoxes. I have set the ComboBox DroppedDown Property to true. Now the actual problem is...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
0
by: tupolev | last post by:
Hi, I already post this item but now I know whats wrong: I want to allow the user to edit the items in a combobox. The problem is that the textchange event works just one time (for the first...
4
by: Keith | last post by:
Hello - this started out as a minor annoyance - and now is starting to bother me more and more - I'm hoping someone can help me. I would like to have a combobox display - NOT initially be blank...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
5
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.