From time to time I use code to simulate key event.
Like this:
Dim kea As New KeyEventArgs(Keys.N)
DataGridView1_KeyDown(sender, kea)
That work’s good.
Now I need same way to send Ctrl+N.
But I can’t find how to do this.
What I try…
Dim kea As New KeyEventArgs(Keys.N And Keys.ControlKey)
But that don’t want to work as expected.
How to do this properly?
As you could have read in the MSDN documentation, you should combine the keys with the bitwise OR operator: