کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

ساب کلاس کردن



Option Compare Database



Public WinProcOld As LongPtr



(Public Function SubClassWnd(hwnd As LongPtr

   ( WinProcOld = SetWindowLongPtr(hwnd, GWL_WNDPROC, AddressOf WindProc

End Function

 

(Public Function UnSubclassWnd(hwnd As LongPtr

    SetWindowLongPtr hwnd, GWL_WNDPROC, WinProcOld

    WinProcOld = 0

End Function

 

'This is your subclassed window procedure

Public Function WindProc(ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, ByVal lParam As LongPtr) As LongPtr

 

    'WM_COMMAND message is sent to parent window to notify of a button click

    'The lParam parameter tells the hWnd of the button

   'If wMsg = WM_CTLCOLORBTN Then WindProc = CreateSolidBrush(RGB(0, 0, 10))

    If wMsg = WM_COMMAND Then

         If lParam = GetDlgItem(hwnd, 4) Then MsgBox "Button was clicked!"

         If lParam = GetDlgItem(hwnd, 1) Then MsgBox "Button was clicked!"

    End If

    If wMsg = WM_DESTROY Then

      UnSubclassWnd hwnd

    End If

      WindProc = CallWindowProc(WinProcOld, hwnd, wMsg, wParam, ByVal lParam)

End Functionc

نظرات 0 + ارسال نظر
برای نمایش آواتار خود در این وبلاگ در سایت Gravatar.com ثبت نام کنید. (راهنما)
ایمیل شما بعد از ثبت نمایش داده نخواهد شد