如何一次显示一种表格? [英] How can i show one form at a time?

查看:95
本文介绍了如何一次显示一种表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在用Visual Basic 2008编写一个软件,希望一次显示一个表单,因此,如果一个表单正在显示,则另一种表单应该被隐藏.
我已经尝试了以下代码,但是它仅显示正在加载"表单,但从未显示"AboutBox".

Hi,

I am writing a software in visual basic 2008 and wanted to show one form at a time so if one form is showing then the other form should be hidden.
I have tried the following code but it just shows the ''Loading'' form but never brings up the ''AboutBox''.

If Loading.Visible = False Then
      AboutBox.Show()
Else : AboutBox.Hide()
End If


任何帮助将不胜感激.


any help would be greatly appreciated.

推荐答案

做到这一点最简单的方法是将各种形式设置为用户控件,并将它们全部放在一种形式上.除此之外,我不知道为什么该代码不起作用,但是鉴于您没有向我们展示任何隐藏加载表单的代码,也没有告诉我们该代码何时运行,因此我想说您有一个操作顺序问题.最好的选择是处理隐藏加载框的事件,然后在该代码中显示关于框.
The easiest way to do this is to make your various forms as user controls and put them all on one form. Beyond that, I don''t know why this code does not work, but given that you''re not showing us any code that hides the loading form, or told us when this code runs, I''d say you have an order of operations problem. Your best bet is to handle the event that hides the loading box and then show the about box in that code.


loading.visible = false


代码中的上一行应该表示未显示加载表单.

此代码在表单加载时运行,因此该代码的子目录为
<pre>Private Sub Form1_Load</pre>


the above line in the code is supposed to say that when the loading form is not showing.

this code runs when the form loads so the sub for this code is
<pre>Private Sub Form1_Load</pre>


这篇关于如何一次显示一种表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆