|
フォームモジュールの先頭から
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "USER32" _
(ByVal Hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, _
ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Sub UserForm_Activate()
Dim Hwnd As Long, Ret As Long
Hwnd = FindWindow("ThunderDFrame", vbNullString)
Ret = SetWindowPos(Hwnd, -1, 0, 0, 0, 0, &H40 Or &H1 Or &H2)
End Sub
'↓コマンドボタンに、この設定を解除するコードを割り当てる場合
Private Sub CommandButton1_Click()
Dim HWnd As Long, Ret As Long
Hwnd = FindWindow("ThunderDFrame", vbNullString)
Ret = SetWindowPos(HWnd, -2, 0, 0, 0,0, &H40 Or &H1 Or &H2)
End Sub
というコードを入れて下さい。これで UserForm1.Show 0 と、モードレスで
ユーザーフォームを立ち上げれば、その効果が理解できるはずです。
|
|