表格预加载??? [英] Form Preloading???

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

问题描述

大家好,


我有一个带有按钮主窗口的应用程序。每个

按钮打开一个新表单,处理

应用程序的不同部分。


这不是MDI应用程序,主窗口在

背景中保持打开状态,所有子窗口都用.ShowDialog()打开。


要打开这些窗口,我使用以下内容主表单上的代码:


Private Sub btnNotas_Click(...)处理btnNotas.Click

Dim frmNotas As new frmNotas

frmNotas.ShowDialog()

frmNotas.Activate()

结束子

在子表单上,关闭(离开)我使用:


Private Sub btnReturn_Click(...)处理btnReturn.Click

Me.Close()

End Sub


此表格需要一段时间才能加载,用户有时会觉得程序

可能没有响应。


有没有办法在启动时预加载这些子表单,而不显示它们直到用户点击指定的按钮n。


如果是这样的话,用什么代码来隐藏它并将控制权返回给主要形式的




就在我这样做的时候,我正在创建一个新的表单实例每个

时间单击按钮并在用户返回时销毁它

主要表格。


提前致谢....

Hi all,

I have an application with a main window full of buttons. Where each
buttons opens a new form that deals with different portions of the
application.

This is not an MDI application, the main window remains open in the
background and all sub windows are opened with .ShowDialog().

To open these windows, I use the following code on the main form:

Private Sub btnNotas_Click( . . . ) Handles btnNotas.Click
Dim frmNotas As New frmNotas
frmNotas.ShowDialog()
frmNotas.Activate()
End Sub
On the child form, to close (leave) I use:

Private Sub btnReturn_Click( . . . ) Handles btnReturn.Click
Me.Close()
End Sub

This forms take time to load and the user sometimes feels the program
may be unresponsive.

Is there a way to preload these child forms at start up, without
showing them until the user clicks on the assigned button.

If so, what would be the code used to hide it and return control to
the main form.

Right as I am doing it, I am creating a new instance of the form every
time the buttons are clicked and destroying it when user returns to
the main form.

Thanks in advance....

推荐答案

aform = New MyForm

aform.Hide()


" Pepi Tonas" < Pe的******* @ hotmail.com>在消息中写道

news:56 ******************************** @ 4ax.com ...
aform = New MyForm
aform.Hide()

"Pepi Tonas" <Pe*******@hotmail.com> wrote in message
news:56********************************@4ax.com...
大家好,

我有一个带有按钮的主窗口的应用程序。每个
按钮打开一个处理
应用程序不同部分的新表单。

这不是MDI应用程序,主窗口仍然在
中打开使用.ShowDialog()打开背景和所有子窗口。

要打开这些窗口,我在主窗体上使用以下代码:

Private Sub btnNotas_Click(。 。)处理btnNotas.Click
Dim frmNotas As new frmNotas
frmNotas.ShowDialog()
frmNotas.Activate()
End Sub

关于孩子表格,关闭(离开)我使用:

私人子btnReturn_Click(...)处理btnReturn.Click
Me.Close()
结束子
<这种形式需要一段时间才能加载,用户有时觉得程序可能没有响应。

有没有办法在启动时预加载这些子表单,而不是
显示它们直到用户点击指定的按钮。

如果是这样,用于隐藏的代码是什么然后将控制权交还给主表单。

正如我所做的那样,我每按一下按钮就会创建一个新的表单实例并将其销毁当用户返回主表单时。

提前致谢....
Hi all,

I have an application with a main window full of buttons. Where each
buttons opens a new form that deals with different portions of the
application.

This is not an MDI application, the main window remains open in the
background and all sub windows are opened with .ShowDialog().

To open these windows, I use the following code on the main form:

Private Sub btnNotas_Click( . . . ) Handles btnNotas.Click
Dim frmNotas As New frmNotas
frmNotas.ShowDialog()
frmNotas.Activate()
End Sub
On the child form, to close (leave) I use:

Private Sub btnReturn_Click( . . . ) Handles btnReturn.Click
Me.Close()
End Sub

This forms take time to load and the user sometimes feels the program
may be unresponsive.

Is there a way to preload these child forms at start up, without
showing them until the user clicks on the assigned button.

If so, what would be the code used to hide it and return control to
the main form.

Right as I am doing it, I am creating a new instance of the form every
time the buttons are clicked and destroying it when user returns to
the main form.

Thanks in advance....





" solex" <所以*** @ nowhere.com>在消息中写道

news:eT ************** @ TK2MSFTNGP09.phx.gbl ...

"solex" <so***@nowhere.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
aform = New MyForm
aform.Hide()
aform = New MyForm
aform.Hide()




Dim mNotas as frmNotas


Sub frmMain_Load()

mNotas =新frmNotas

结束子


私人子btnNotas_Click(...)处理btnNotas.Click

mNotas。 ShowDialog()

mNotas.Activate()

End Sub

与solex描述的内容类似,但更好地理解......和

是的,这是我的头脑,不会按原样工作......但会显示它是如何工作的。


Mythran



Dim mNotas As frmNotas

Sub frmMain_Load()
mNotas = New frmNotas
End Sub

Private Sub btnNotas_Click(...) Handles btnNotas.Click
mNotas.ShowDialog()
mNotas.Activate()
End Sub
Similar to what solex described briefly but gives a better understanding...and
yes, this is off top of my head, will not work as is...but shows how it can work.

Mythran


" Pepi Tonas" < Pe的******* @ hotmail.com> schrieb
"Pepi Tonas" <Pe*******@hotmail.com> schrieb
Private Sub btnNotas_Click(...)处理btnNotas.Click
Dim frmNotas As new frmNotas
frmNotas.ShowDialog()
frmNotas.Activate()
结束Sub


frmNotas.Activate()没有意义,因为当

激活执行时,Form是不可见的。


这种形式需要一段时间才能加载,用户有时觉得
程序可能没有响应。
Private Sub btnNotas_Click( . . . ) Handles btnNotas.Click
Dim frmNotas As New frmNotas
frmNotas.ShowDialog()
frmNotas.Activate()
End Sub
frmNotas.Activate() doesn''t make sense because the Form is invisible when
Activate is executed.

This forms take time to load and the user sometimes feels the
program may be unresponsive.




为什么不显示沙漏?

-

Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html



Why not display an hourglass?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


这篇关于表格预加载???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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