07/01/31 00:50:34
>>127
できるけどやる意味ないだろ
MDIで十分
Option Explicit
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private WithEvents cmd As CommandButton
Private Sub Form_Load()
Set cmd = Me.Controls.Add("VB.CommandButton", "cmd")
With cmd
.Caption = "Click"
.Move 0, 0, 1000, 1000
.Visible = True
End With
End Sub
Private Sub cmd_Click()
Dim f As Form1
Set f = Forms.Add("Form1")
Call SetParent(f.hWnd, Me.hWnd)
Call f.Show
End Sub