哦,忘了你第二个问题了
Private Sub MDIForm_Resize()
If MDIForm1.WindowState <> 1 Then
Dim ctrlTmp As Control
For Each ctrlTmp In MDIForm1.Controls
If TypeOf ctrlTmp Is PictureBox Then
Else
ctrlTmp.Width = MDIForm1.Width / 5
ctrlTmp.Height = MDIForm1.Height / 5
End If
Next ctrlTmp
End If
End Sub
不是被picturebox1遮住了,是在它的y方向下边
给你段代码
Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Option Explicit
Private Sub MDIForm_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.Show
SetParent Form1.hWnd, Picture1.hWnd
End Sub
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
SetParent Form1.hWnd, MDIForm1.hWnd
Unload Form1
End Sub
记得关闭窗体时要设回其父窗体,不然会出错