漂亮的WORD欢迎LOGO,声色俱备。 窗体中置于flash动画,窗体可以调大小(这是重点)
w7VMNrY2.rar
(79.96 KB, 下载次数: 108)
Private Sub CommandButton1_Click()'单击控件按钮时之代码 Application.Visible = False '将WORD隐藏 UserForm1.Show 0 '以无模式运行窗体 End Sub '结束过程 Private Sub Document_open() '打开WORD时运行之代码 Application.Visible = False '将WORD隐藏 UserForm1.Show 0 '以无模式运行窗体 End Sub Option Explicit Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long 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 ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long Private Const SW_SHOW As Long = 5 Private Const GWL_STYLE = (-16) Private Const WS_THICKFRAME As Long = &H40000 Private Const WS_MINIMIZEBOX As Long = &H20000 Private Const WS_MAXIMIZEBOX = &H10000 Function hWnd() As Long hWnd = FindWindow(IIf(Val(Application.Version) > 8, "ThunderDFrame", "ThunderXFrame"), lpWindowName:=Me.Caption) End Function 以上为声明API函数 Private Sub UserForm_Activate() '激活窗体时运行代码 Dim IStyle As Long '声明变量 IStyle = GetWindowLong(Me.hWnd, GWL_STYLE) '设置变量值--线型 IStyle = IStyle Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX SetWindowLong Me.hWnd, GWL_STYLE, IStyle ShowWindow Me.hWnd, SW_SHOW DrawMenuBar Me.hWnd End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)'关闭窗体时运行代码 Application.Visible = True '让WORD可见 End Sub '过程结束 Private Sub UserForm_Resize() '重调窗体大小 UserForm1.ShockwaveFlash1.Width = UserForm1.Width - 6 'flash动画之宽度等于窗体宽度减6 UserForm1.ShockwaveFlash1.Height = UserForm1.Height - 6 'flash动画之高度等于窗体高度减6
End Sub '结束过程
[此贴子已经被作者于2006-12-13 8:57:14编辑过] |