如何设置分步流程

发布于 2024-10-17 05:35:45 字数 201 浏览 5 评论 0原文

我正在创建一个必须处理一家小公司的构建案例的应用程序。为了让员工创建一个新案例,我想让他们经历一个循序渐进的过程。我如何设置这样的流程?

我尝试过将它们放在面板上,但这仍然看起来不是解决这个问题的优雅方法。

现在我正在单独隐藏/显示大量文本框和列表框。是否有一些更聪明(更正确)的方法来对它们进行分组。或者有人可以建议另一种方法吗?我正在用 c# 构建它。

I'm creating an application that has to handle the construction cases of a small company. In order for the employees to create a new case, I want to put them through a step-by-step process. How do i setup up such a process?

I've tried putting them on panels instead, but this still seams like a not so elegant way to solve this problem.

Right now i'm hiding/showing lots of textboxes and listboxes individually. Is there some smarter(more correct) way to group these. Or could someone suggest another approach to this? I'm building it in c#.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魂归处 2024-10-24 05:35:45

我在这种情况下使用的最好方法是为 UserControl 中的一个步骤创建所有按钮、文本框等,并对每个步骤执行相同的操作,并更好地将特定于该步骤的所有代码嵌入该控件本身。

在表单上只保留那些对每个步骤通用的控件。然后有一个容器控件,例如 面板在表单上作为占位符(这样您就不必担心定位......但是您甚至可以在代码中设置表单上控件的位置并直接将其添加到表单的控件集合中)

然后第一步创建一个新的第一个步骤的 UserCotrol 实例,并将第一个 UserControl 添加到表单控件集合或该容器控件(面板)中,然后在下一步中将其删除并替换为下一个 UserControl。

这样,您就不会一直在内存中拥有所有控件,并且它们将在需要时创建,并在不需要时释放。它高效并且隔离每个步骤,以便每个步骤都有可管理的代码。

The best way i have used in this scenario is to create all your Buttons, Textboxes, etc for one step in a UserControl and do the same for each step and better embed all your code specific to that step in that control itself.

On Form only keep those controls which are Universal for every Steps. Then have a container control like a Panel on the form as a Placeholder (so that you don't have to worry about positioning ..however you can even in code set the Location of the Control on Form and directly Add it to Form's Controls Collection)

Then on first step create a new instance of UserCotrol for Fisrt Step and add the first UserControl to the Forms Control Collection or that Container Control (Panel) and on next step Remove it and Replace it with Next UserControl.

This way you wont have all controls in the Memory all the Time and they will be created when required and Disposed when not required. Its Efficient and also isolate each step so you have manageable code for each step.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文