在桌面应用程序,Windows应用程序中具有Next / Pervious Button。 [英] Having Next/Pervious Button in desktop application, windows application.

查看:55
本文介绍了在桌面应用程序,Windows应用程序中具有Next / Pervious Button。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


任何人都可以帮助我吗?

如何移动到下一个表格并返回而无需在窗口中打开新表格应用。我尝试在Form1中使用

Form2 f2 = new Form2();

f2.show();

但问题在于技术打开新表单,如果我回到Form1修改一些信息并再次返回到Form2,我将有一个Form2的新窗口。例如,假设我有一个问号应用程序和一个表单中的每个问题,并且想要在不打开新表格的情况下更改以前的答案,最好的技术是什么? 。

我知道在Web应用程序中有Response.Redirect。用来。


那么,有人可以帮我解决下一个/上一个应用程序的问题吗?

Hi everybody,

Can anyone help me ?
How do I move to the next Form and go back without having to open new Form in window application. I tried to use in Form1
Form2 f2 = new Form2();
f2.show();
but the problem is that technique opens new Form and if I went to go back to Form1 to modify some info and get back again to Form2, I will have new window of Form2. For example, lets say that I have questioneer application and a each question in a Form by itself and want to change the previous answers without opening new Forms, what is the best techniqe? .
I know that in web application the "Response.Redirect" is used.

So, is anyone can help me on how to have Next/Previous application?

推荐答案

请阅读我的回复# 7 这个主题。
Please read my reply #7 in this thread.





有几种方法可以解决这个问题。您可以考虑在主应用程序类中创建一个公共静态表单数组(默认情况下为Program.cs),或者您可以创建一个包装类,每个表单都继承自,包装器包含数组。


这样您的应用程序是可扩展的,因为您可以轻松添加和删除表单,而无需更改代码。下面是Next按钮的功能:

Hi,

There are a couple of ways to approach this. You could look into creating a public static form array in your main application class (Program.cs by default) or you could create a wrapper class which each form inherits from, with the wrapper containing the array.

This way your application is extensible as you can easily add and remove forms without having to change the code. Below is how the Next button might function:

展开 | 选择 | Wrap | 行号


@ cloud255


..正确的方法取决于程序设计(如果有的话)。请参阅上面的回复。
@cloud255
.. and the correct way depends on the program design if any. See my reply above.


这篇关于在桌面应用程序,Windows应用程序中具有Next / Pervious Button。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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