ComboBox VB.net question

C

Coderacer

Hi

I have an Array(20) and 2 ComboBoxes in my form class. My idea is to
add items of Array to ComboBox2 in such a way that if, say, you make a
choice A in ComboBox1, Array items 1 thru 10 will get added; If you
choose choice B in ComboBox1, Array items 1-20 items gets added to
ComboBox2. So far so good, BUT THE PROBLEM IS

When I start the form and make a selection A in ComboBox1, Array items
1thru 10 are getting added without a problem. Now if I choose B in
ComboBox1, Array items 1 thru 20 are getting APPENDED to already
existing 1 thru 10 items from previous selection. I tried to write
following code to refresh the ComboBox selections, when I ever I change
SelectIndexChanged for ComboBox1, but no success. Can anybody please
help, I appreciate any help. Thank you.

N = Integer.Parse(ComboBox2.Items.Count)
MsgBox("N")
For L = 0 To N - 1
ComboBox2.Items.RemoveAt(L)
Next L
 
S

Scott M.

Is this an ASP.NET application? If so, set the ComboBox's EnableViewState
property to False.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top