7,789
社区成员
发帖
与我相关
我的任务
分享Option Explicit
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click()
Load Form2
SetParent Form2.hwnd, Me.hwnd
Form2.Show
MsgBox GetParent(Form2.hwnd) '为何返回的结果是0而不是form1.hwnd?
End Sub
Private Sub Form_Load()
Me.Caption = Me.hwnd
End Sub