Link to home
Start Free TrialLog in
Avatar of searchsanjaysharma
searchsanjaysharma

asked on

How to enable the combobox to be read only mode. It should not be editable.

In VB.Net Windows programming,
I am using combobox. At the top or first item is --Select City--.
I need two things.
1.First how to make it non editable.
2.How to reset it to --Select City-- on click on reset button.
Avatar of nepaluz
nepaluz
Flag of United Kingdom of Great Britain and Northern Ireland image

1. Set the DropDownStyle to list,e.g
        Dim xc As New ComboBox
        xc.DropDownStyle = ComboBoxStyle.DropDownList

Open in new window

2. Add this to your Rest Button click event
xc.SelectedValue = "--Select City--"

Open in new window

Avatar of searchsanjaysharma
searchsanjaysharma

ASKER

cmblastqualification.SelectedValue = "--Select Last Qualification"
            cmbcourse.SelectedValue = "--Select Course--"

This code is not working, here cmblastqualification and cmbcourse are the combboxes.
ASKER CERTIFIED SOLUTION
Avatar of nepaluz
nepaluz
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial