Free Support Forum - aspose.com

How to suppress a key press in cellkeypressed events

I am a biginner of VB, how can I suppress a key press in CellKeyPressed events in my example:

Private Sub GridDesktop1_CellKeyPressed(ByVal sender As Object, ByVal e As Aspose.Grid.Desktop.CellKeyEventArgs) Handles GridDesktop1.CellKeyPressed

If e.KeyCode = 65 Then

e.SuppressKeyPress = True

Else

e.SuppressKeyPress = False

End If

End Sub

I can suppress the "A" in the cell if cell is empty, somehow if I key-in "1A" then the keystroke will bypass the above procedure.


This message was posted using Page2Forum from CELLKEYPRESSED - Aspose Search Results - Aspose.com

Hi,

Please try the attached version v2.0.1.6 with the modified code:

Private Sub grdDataEntry_CellKeyPressed(ByVal sender As Object, ByVal e As Aspose.Grid.Desktop.CellKeyEventArgs) Handles grdDataEntry.CellKeyPressed<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

If e.KeyCode = 65 Then

e.Handled = True

Else

e.Handled = False

End If

End Sub

In this version, we have enhanced CellKeyPressed event for your requirement.

Thank you.

The issues you have found earlier (filed as 8680) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.