rahul89.agarwal
New member
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
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
