主题:请问各位高手,要自动运行多个人窗体代码怎么写啊?
剑南烟雨
[专家分:0] 发布于 2012-12-19 15:32:00
有8个单击事件的独立窗体,如何实现单击Form1运行结束后,自动运行Form2,Form2运行结束后,又自动运行Form3。依次类推直到Form8结束。
小弟无从下手,请问各位高手,这代码怎么写啊?
独立窗体即是各个窗体之间没有数据专递,或调用。
回复列表 (共7个回复)
沙发
剑南烟雨 [专家分:0] 发布于 2012-12-19 22:35:00
老大出来帮帮忙啊!
板凳
一江秋水 [专家分:9680] 发布于 2012-12-20 12:36:00
form1:
Private Sub Form_Click()
Form2.Show
Unload Me
End Sub
form2:
Private Sub Form_Click()
Form3.Show
Unload Me
End Sub
.....
3 楼
剑南烟雨 [专家分:0] 发布于 2012-12-20 19:35:00
谢谢 一江秋水 终于大功告成。
每个窗体里定义一个公共函数
然后就用下面的程式:
Private Sub Form_Click()
AAA
Unload Me
Form2.BBB
Unload Me
Form3.CCC
Unload Me
Form4.DDD
Unload Me
Form5.EEE
Unload Me
Form6.FFF
Unload Me
Form7.GGG
Unload Me
Form8.HHH
Unload Me
End Sub
4 楼
biansky [专家分:10] 发布于 2013-01-31 17:54:00
Major League Baseball "45" number. So then [url=http://www.cheapjordanforsale.us/air-jordan-4-retro-c-4.html]retro jordan 4[/url] shoes followed by No. 45 embroidered white line no.3, 5000 dollar fines dispute In the second game of the Eastern Conference [url=http://www.cheapjordanforsale.us/air-jordan-6-retro-c-6.html]retro jordan 6[/url] semifinals, the Father re-donned the jersey number "23", scored 38 points, but the foot wear or [url=http://www.cheapjordanforsale.us/air-jordan-7-retro-c-8.html]retro jordan 7[/url] embroidered with "45" was too black and white [url=http://www.cheapjordanforsale.us/air-jordan-9-retro-c-9.html]retro jordan 9[/url], then the Bulls away combat, black and white home color [url=http://www.cheapjordanforsale.us/air-jordan-10-retro-c-10.html]retro jordan 10[/url] and away the color does not match, so the Father was also fined $ 5,000 per game, the Father suddenly re-wear jersey No. 23, again by a [url=http://www.cheapjordanforsale.us/air-jordan-11-retro-c-11.html]retro jordan 11[/url] fine of $ 25,000 per game. concord directly translated into "Concord grapes", varieties of Americas grapes, [url=http://www.cheapjordanforsale.us/air-jordan-11-retro-c-11.html]jordan 11 Concord[/url] crystal outsole echoes the color with purple soles, while the color name from the soles of purple the no.5, hot on sale very terrible [url=http://www.cheapjordanforsale.us/air-jordan-12-retro-c-12.html]retro jordan 12[/url] finally listed, each Offer shops outside there are people waiting in line, some people even crushed glass [url=http://www.cheapjordanforsale.us/air-jordan-13-retro-c-13.html]retro jordan 13[/url] doors across the security downtown into the store to try to steal these shoes, in order to buy it at all costs, its all crazy!
5 楼
孙瑞 [专家分:590] 发布于 2014-04-24 23:27:00
[quote]谢谢 一江秋水 终于大功告成。
每个窗体里定义一个公共函数
然后就用下面的程式:
Private Sub Form_Click()
AAA
Unload Me
Form2.BBB
Unload Me
Form3.CCC
Unload Me
Form4.DDD
Unload Me
Form5.EEE
Unload Me
Form6.FFF
Unload Me
Form7.GGG
Unload Me
Form8.HHH
Unload Me
End Sub[/quote]
Private Sub Form_Click()
AAA
Unload Me
Form2.BBB
Unload Me
Form3.CCC
Unload Me
Form4.DDD
Unload Me
Form5.EEE
Unload Me
Form6.FFF
Unload Me
Form7.GGG
Unload Me
Form8.HHH
Unload Me
End Sub
6 楼
guoyong_cy [专家分:3050] 发布于 2014-04-25 21:52:00
怎么回事,高手都把问题想复杂了吧
为什么不用这个简单的:
Sub main()
Form1.Show vbModal
Form2.Show vbModal
Form3.Show vbModal
.
.
.
formN.Show vbModal
End Sub
7 楼
孙瑞 [专家分:590] 发布于 2014-04-25 23:46:00
[quote]怎么回事,高手都把问题想复杂了吧
为什么不用这个简单的:
Sub main()
Form1.Show vbModal
Form2.Show vbModal
Form3.Show vbModal
.
.
.
formN.Show vbModal
End Sub
[/quote]
这个真的没想到,用模态窗口的方法,让窗口必须关闭后才能执行后面的代码,智慧!
我来回复