Hi
I have an app with datagrids in it. Although you can directly cut,
paste, etc elements from the grid using Ctrl-C and the like, I would
like to provide the standard Edit menu of most Windows programs. The
Cut, Copy, Paste and Select All menu options will perform the expected
operation on the data grid.
I have tried implementing this by focusing on the datagrid, and sending
the shortcut keys for the operation using the SendKeys method. For
example, this subroutine is called when the Cut menu option is clicked
Public Sub Cut()
myDataGrid.Focus()
SendKeys.Send("^x")
End Sub
Alas, this doesn't work. The very first time I select a menu item, it
freezes the program. Pressing Ctrl-Alt-Del unfreezes it, and then any
other menu selection performed after this will not freeze the program,
but it still does nothing.
Anybody know why this doesnt work or a better way to do this?
cheers
MQ