回 帖 发 新 帖 刷新版面

主题:请问各位高手,要自动运行多个人窗体代码怎么写啊?

 

有8个单击事件的独立窗体,如何实现单击Form1运行结束后,自动运行Form2,Form2运行结束后,又自动运行Form3。依次类推直到Form8结束。
小弟无从下手,请问各位高手,这代码怎么写啊?

独立窗体即是各个窗体之间没有数据专递,或调用。

回复列表 (共7个回复)

沙发

老大出来帮帮忙啊!

板凳

form1:

Private Sub Form_Click()
Form2.Show
Unload Me
End Sub

form2:

Private Sub Form_Click()
Form3.Show
Unload Me
End Sub

.....

3 楼

谢谢 一江秋水 终于大功告成。
每个窗体里定义一个公共函数
然后就用下面的程式:

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 楼

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 楼

[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 楼

怎么回事,高手都把问题想复杂了吧
为什么不用这个简单的:
Sub main()
Form1.Show vbModal
Form2.Show vbModal
Form3.Show vbModal
.
.
.
formN.Show vbModal
End Sub

7 楼

[quote]怎么回事,高手都把问题想复杂了吧
为什么不用这个简单的:
Sub main()
Form1.Show vbModal
Form2.Show vbModal
Form3.Show vbModal
.
.
.
formN.Show vbModal
End Sub
[/quote]
这个真的没想到,用模态窗口的方法,让窗口必须关闭后才能执行后面的代码,智慧!

我来回复

您尚未登录,请登录后再回复。点此登录或注册