首页 > 编程 > .NET > 正文

[VB.NET]浅谈MDI窗体的多窗体编程

2024-07-10 13:00:46
字体:
来源:转载
供稿:网友
---mdi窗体和多窗体编程--- 目的:在mdi窗体内用toolbar实现多窗体的实例,在vb.net中显示窗体一般代码如下
private sub toolbar1_buttonclick()sub toolbar1_buttonclick(byval sender as system.object, byval e as system.windows.forms.toolbarbuttonclickeventargs) handles toolbar1.buttonclick
select case e.button.text
case "ok" '"ok" is toolbarbutton.text
dim fr as new frmname
fr.mdiparent = me 'me is mdiform
fr.show()
end select
end sub


http://www.chinaaspx.com/club/topic_5_7796.htm

参考了一下,得出下面的代码


private shared fr as new frmname
private sub toolbar1_buttonclick()sub toolbar1_buttonclick(byval sender as system.object, byval e as system.windows.forms.toolbarbuttonclickeventargs) handles toolbar1.buttonclick
select case e.button.text
case "ok" '"ok" is toolbarbutton.text
if fr is nothing or fr.isdisposed then
fr = new frmname
fr.mdiparent = me
fr.show()
else
fr.mdiparent = me
fr.show()
fr.focus()
end if
end select
end sub
这样就实例了一次窗体~ ---end---
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表