Combo Box Problem

RCBrust

New member
Joined
Oct 26, 2004
Messages
1
Programming Experience
1-3
I have an application with multiple combo boxes. If I want to change a combo box selection from within the code, I can use:

cbxB.SelectedIndex = 0

for example, which will select the first item. This code works fine. The problem is that when I click on say combo box A and make a selection, I want combo box B to also change. If I put the above line of code in the subroutine for clicking combo box A, I get a "Specified argument was out of the range of valid values" error. If I put the same line somewhere else in the program, it works fine.

Is there some reason why you can't control one combo box from the subroutine of another?

Thanks,
Randy
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
cboA_selectedindexchanged event:
cboB.selectedindex = cboA.selectedindex
 
Top Bottom