Hi folks
Im trying to delete an entry from a datagrid programmatically.
The entry would be a trapped duplicate record for a table.
Can I send a delete key call to the the api and thus the datagrid.
I tried keybd_event and sendkeys.
no good
Printable View
Hi folks
Im trying to delete an entry from a datagrid programmatically.
The entry would be a trapped duplicate record for a table.
Can I send a delete key call to the the api and thus the datagrid.
I tried keybd_event and sendkeys.
no good
This should do it, just make hWnd = the window name.
In a Form:
To find hWnd, you would have to do something like this:Code:Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_KEYDOWN = &H100
Private Const WM_KEYUP = &H101
Private Sub Command1_Click()
SendMessage hWnd, WM_KEYDOWN, 46, 0&
SendMessage hWnd, WM_KEYUP, 46, 0&
End Sub
Code:Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Function FindWnd() As Long
FindWnd& = FindWindow(vbNullString, "Notepad")
End Function
Cheers Folks
What would we, the VB novices so without yis all