VB.NET comboBox help !!
-
In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.
-
In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.
Saam_cse wrote:
But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.
If the combobox is being removed from the form, you're still in the designer, not the running application. You cannot just click on a control and delete it unless you provide the code to do so.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.
ok see this, the items on the Combobox will not be edited.
comboBox1.Items.Add("First");
comboBox1.Items.Add("Second");
comboBox1.Items.Add("Third");
comboBox1.Items.Add("Forth");
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;Hope this is what you want
Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za
-
In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.