VB.NET章鱼哥出品—如何解决MDI子窗体被父窗体中的控件覆盖的问题
2020-12-13 15:57
标签:blog http io ar for on 2014 问题 log VB.NET章鱼哥出品—如何解决MDI子窗体被父窗体中的控件覆盖的问题 标签:blog http io ar for on 2014 问题 log 原文地址:http://blog.csdn.net/zhangyubishoulin/article/details/40854617Public Class Form1
'作者:章鱼哥,QQ:3107073263 群:309816713
'如有疑问或好的建议请联系我,大家一起进步
'声明SetParent函数,这是一个API函数
Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.IsMdiContainer = True '将Form1设置为父窗体容器
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Form1是父窗体,Form2是子窗体
SetParent(Form2.Handle, Me.Handle)
Form2.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SetParent(Form3.Handle, Me.Handle)
Form3.Show()
End Sub
End Class
截图效果:
文章标题:VB.NET章鱼哥出品—如何解决MDI子窗体被父窗体中的控件覆盖的问题
文章链接:http://soscw.com/essay/35572.html