Office中国论坛/Access中国论坛

标题: [分享]呵呵,用了这个,俺不知怎样关闭报表了 [打印本页]

作者: secowu    时间: 2005-11-5 02:30
标题: [分享]呵呵,用了这个,俺不知怎样关闭报表了
2002

Private Declare Function SetWindowLong Lib "user32" Alias _

        "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _

        ByVal dwNewLong As Long) As Long

   Private Declare Function GetWindowLong Lib "user32" Alias _

        "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) _

        As Long



   'Establish constants for elements of the Window.

   Const WS_MINIMIZEBOX = &H20000 'creates a window with a maximize box

   Const WS_MAXIMIZEBOX = &H10000 'creates a window with a minimize box

   Const WS_SYSMENU = &H80000 'creates window with a System-Menubox in its titlebar.



   Const GWL_STYLE = (-16)



Private Sub Report_Activate()



   Dim L As Long



   'Get the current style.

   L = GetWindowLong(Me.hwnd, GWL_STYLE)



   'Modify the current style, subtracting

   'the System menu. This removes the Close button also.

   L = L And Not (WS_SYSMENU)



   'Also modify the current style, subtracting the

   'Minimize & Maximize buttons, by uncommenting the following

   'line and commenting the line above.

   'If you subtract the Minimize button, the Maximize button is

   'also subtacted and vice versa.

   ''L = L And Not (WS_MINIMIZEBOX)

   ''L = L And Not (WS_MAXIMIZEBOX)



   L = SetWindowLong(Me.hwnd, GWL_STYLE, L)



End Sub

http://support.microsoft.com/default.aspx?scid=kb;en-us;304312

http://support.microsoft.com/default.aspx?scid=kb;en-us;304313




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3