多次打开表格 [英] Open a Form a Number of Times

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

问题描述

此外,

我有一个应用程序可以打开1个表单,具体取决于用户选择的号码...

问题在于,每个应用程序时间窗体打开它销毁变量(我的数组列表)并在...上创建它...

我该怎么办才能使其保留该数组列表和所有以前的信息?

Jp

Also,

I Have an Application that Opens 1 form Numerous Times Depending on a Number the User Picks...

The Problem with it is that each time the Form Opens it Destroys the Variables(My Arraylist) and Creates it over...

What do i have to do so that it Keeps that Arraylist and all the Previous info in it?

Jp

推荐答案

要么重复显示相同的形式,要么使这些变量变静态的.或者也许将它们存储在一个单独的类中,该类由它自己进行序列化,并且是单例,因此所有表单实例都可以从那里访问相同的数据.

Either show the same form over and over, or make those variables static.  Or perhaps store them in a seperate class that does it''s own serialisation, and is a singleton, so all form instances can access the same data from there.

如果您发布了代码,那么我将就如何更改它提出具体建议.如果信息"包含控件的状态,那么除非反复编写相同的表单而不是创建新的表单,否则除非您还编写代码来保存和恢复这些状态,否则窍门不存在.

If you posted code, then I''d have made specific suggestions on how to change it.  If the ''info'' includes the state of controls, then only showing the same form over and over instead of creating new ones will do the trick, unless you also write code to save and restore those states.


谢谢!

我尝试一下,明天将代码发送给您...

我不知道那里对您的答案发表评论,但谢谢:)

Thanks!

Il try that and send u the code tomorrow...

I duno where to comment on your Answer But Thanks :)


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

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