how to disable user inputs in combobox to prevent changing default text

rahul89.agarwal

New member
Joined
Aug 6, 2010
Messages
1
Location
Kolkata,India
Programming Experience
Beginner
i hv created a combobox with dropdownstyle=dropdown and a default text="- - - - Select Profile - - - -"
now i want that user cannot change the default text
i cannot use dropdownstyle=dropdownlist because it does not allow a default text which is a must
the code i written is below but this not works,please help me

Private Sub Combo_profileSelector_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Combo_profileSelector.KeyPress

If (Microsoft.VisualBasic.Asc(e.KeyChar) >= 0 Or Microsoft _
.VisualBasic.Asc(e.KeyChar) <= 127) Then
ipt = MsgBox("You Cannot Edit Items Here", MsgBoxStyle.Information, "Information")
If ipt = MsgBoxResult.Ok Then
Combo_profileSelector.Text = "- - - - Select Profile - - - -"
End If
End If

End Sub:confused:
 
Back
Top