Using TrueDB Grid and when right clicking in current cell the edit popup menu comes up. I don't want this to happen. I'm going to display my own frame.
Help??
Thanks LW
Printable View
Using TrueDB Grid and when right clicking in current cell the edit popup menu comes up. I don't want this to happen. I'm going to display my own frame.
Help??
Thanks LW
I've never worked with the TrueDB Grid control, but I believe you can subclass it by intercepting the WM_NCRBUTTONDOWN message.
VB Code:
Public Declare Function SetWindowLong& Lib "user32" _ Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As _ Long, ByVal dwNewLong As Long) Public Declare Function CallWindowProc Lib "user32" _ Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal _ hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal _ lParam As Long) As Long Const GWL_WNDPROC = (-4) Const WM_NCRBUTTONDOWN = &HA4 Public WndProcOld As Long Public Function WindProc(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long If wMsg = WM_MYMESSAGE Then MsgBox "Message recieved" Exit Function End If WindProc = CallWindowProc(WndProcOld&, hwnd&, wMsg&, wParam&, lParam&) End Function Sub SubClassWnd(hwnd As Long) WndProcOld& = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf WindProc) End Sub Sub UnSubclassWnd(hwnd As Long) SetWindowLong hwnd, GWL_WNDPROC, WndProcOld& WndProcOld& = 0 End Sub '[b][u]Usage[/u][/b] Private Sub Form_Load() SubClassWnd hwnd End Sub Private Sub Form_Unload(Cancel As Integer) UnSubclassWnd hwnd End Sub