in VB6 you could cancel a keypress event by setting KeyAscii = 0
is there a way to do this in .NET since the KeyChar property on EventArgs is read only?
Printable View
in VB6 you could cancel a keypress event by setting KeyAscii = 0
is there a way to do this in .NET since the KeyChar property on EventArgs is read only?
This example is for a combobox. You can use the Handled property.
VB Code:
Private Sub cmbAgents_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbAgents.KeyPress ' Prevents the user to edit the content of the combobox e.Handled = True End Sub