I've got a program that asks the user a series of questions, sort of like a survey. The answers are stored in an SQLite table.
If the user re-visits a question, I need for the previous answer to be displayed - the right radio buttons and checkboxed must be checked, text boxes filled out, and so on. All of this is working just fine except for my combo boxes.
I create the combo box at runtime via AddComboBox(). But when I try to set the SelectedIndex, it goes kablooey.
The line in the code is:
Control( iControlName ).SelectedIndex = xi
where the control is a combo box;
the combo box has had ten items added to it, so Control( iControlName ).Count = 11 (my ten items plus the 'blank' item at SelectedIndex= -1);
xi = 3.
The specific error message is:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Given that the combo box has eleven (11) items in it, how can this be happening?
As always, any and all help is greatly appreciated.
:sign0163:
If the user re-visits a question, I need for the previous answer to be displayed - the right radio buttons and checkboxed must be checked, text boxes filled out, and so on. All of this is working just fine except for my combo boxes.
I create the combo box at runtime via AddComboBox(). But when I try to set the SelectedIndex, it goes kablooey.
The line in the code is:
Control( iControlName ).SelectedIndex = xi
where the control is a combo box;
the combo box has had ten items added to it, so Control( iControlName ).Count = 11 (my ten items plus the 'blank' item at SelectedIndex= -1);
xi = 3.
The specific error message is:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Given that the combo box has eleven (11) items in it, how can this be happening?
As always, any and all help is greatly appreciated.
:sign0163: