返回列表 上一主題 發帖

UserForm 的使用問題

呵呵呵~ 剛好有寫過! 試試看吧!

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 Const GWL_style = (-16)
Private Const CLOSEBOX As Long = &H80000

Private Sub UserForm_Initialize()
    Dim hWndform As Long
    Dim Istyle As Long
   
    hWndform = FindWindow("Test", Me.Caption)
    Istyle = Istyle And Not CLOSEBOX
    SetWindowLong hWndform, GWL_style, Istyle
End Sub
若是我回答,使您滿意,請您讓我知道!                  
若是我的回覆,您仍有其他見解,也請您不嗇指教!

TOP

        靜思自在 : 【為善競爭】人生要為善競爭,分秒必爭。
返回列表 上一主題