displaying a particular comboBox value
-
hello friends, i have some values displayed in a comboBox. the selected value is stored in a variable. now the logic is this that when a button is pressed, the saved value of the combo Box is to be displayed in the combo Box. how do i accomplish this? i have tried adding the value through the 'Items' property. it adds the value into the combolist but doesn't display it directly. i've also tried the comboBox.SelectedValue property but it still doesn't work. :sigh:
private void back_button_Click(object sender, System.EventArgs e) { comboBox1.SelectedValue = field_entries_array[x,3]; }//end function
reply soon plz. Saira -
hello friends, i have some values displayed in a comboBox. the selected value is stored in a variable. now the logic is this that when a button is pressed, the saved value of the combo Box is to be displayed in the combo Box. how do i accomplish this? i have tried adding the value through the 'Items' property. it adds the value into the combolist but doesn't display it directly. i've also tried the comboBox.SelectedValue property but it still doesn't work. :sigh:
private void back_button_Click(object sender, System.EventArgs e) { comboBox1.SelectedValue = field_entries_array[x,3]; }//end function
reply soon plz. Sairawhy don't you use the text property for combobox combobox1.text="hello" Yogesh Agarwal
-
why don't you use the text property for combobox combobox1.text="hello" Yogesh Agarwal
ok the property worked partially. now the comboBox is displaying the value once. suppose we have three values stored in the array. a1,a2 and a3. the above mentioned property displays the value stored in a3 but after pressing the back button again, it still displays the value of a3. it should display the value of a2 and then if the button is pressed again then a1.
-
ok the property worked partially. now the comboBox is displaying the value once. suppose we have three values stored in the array. a1,a2 and a3. the above mentioned property displays the value stored in a3 but after pressing the back button again, it still displays the value of a3. it should display the value of a2 and then if the button is pressed again then a1.
For that do change in value like When you click on the back button use Combobox1.Text=a2 then a1 Yogesh Agarwal
-
For that do change in value like When you click on the back button use Combobox1.Text=a2 then a1 Yogesh Agarwal
my problems solved :laugh: Muajaaan e maujaan:rose: