简体   繁体   English

在C#2.0中创建向导的最佳方法是什么?

[英]What is the best way to create a wizard in C# 2.0?

I have a winforms application where users will be creating stock items, and a time of creation there are a number of different things that need to happen. 我有一个winforms应用程序,用户将创建库存项目,创建时间需要发生许多不同的事情。

I think the UI for this should probably be a wizard of some kind, but I'm unsure as to the best way to achieve this. 我认为这个UI可能应该是某种向导,但我不确定实现这一目标的最佳方法。 I have seen a couple of 3rd party Wizard controls, and I have also seen manual implementations of making panel visible/invisible. 我已经看到了几个第三方向导控件,我也看到了使面板可见/不可见的手动实现。

What are the best ways that people have used in the past, that are easy to implement, and also make it easy to add "pages" to the wizard later on if needed? 人们过去使用过的最好的方法是什么,易于实现,如果需要,还可以在以后轻松地向向导添加“页面”?

I know this answer has already been accepted, but I just found a better Wizard control that's free, and of course, since it's on CodeProject, includes the source, so you can modify it if it's not exactly what you want. 我知道这个答案已经被接受了,但是我发现了一个更好的Wizard控件是免费的,当然,因为它在CodeProject上,包括源代码,所以你可以修改它,如果它不是你想要的。 I'm adding this as an answer for the next person to stumble across this question looking for a good Wizard control. 我正在添加这个作为下一个人的答案,偶然发现这个问题寻找一个好的精灵控制。

http://www.codeproject.com/KB/miscctrl/DesignTimeWizard.aspx http://www.codeproject.com/KB/miscctrl/DesignTimeWizard.aspx

Use a tab-control inside a form. 在表单中使用制表符控件。

Change back color to "Control" in all tab-pages. 在所有选项卡页面中将颜色更改为“控制”。

Set "appearance" to flat buttons to get rid of the white border-stuff. 将“外观”设置为平面按钮以摆脱白色边框。

Hide the tabs by sizing the entire control so that the tabs gets pushed up "under" the title bar of the form. 通过调整整个控件的大小来隐藏选项卡,以便将选项卡向上推到窗体标题栏的“下方”。 If you need other controls (or banner maybe) above the tab-control, then instead hide the tabs with a panel-control or similar. 如果您需要在选项卡控件上方使用其他控件(或横幅),则可以使用面板控件或类似控件隐藏选项卡。

Childplay to code logic for back/next buttons and very easy to extend with new pages. Childplay为后退/下一个按钮编写逻辑代码,并且很容易用新页面扩展。

Here are a few more resources you should check out: 以下是您应该查看的更多资源:

  1. This DevExpress WinForms control: http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/ 这个DevExpress WinForms控件: http//www.devexpress.com/Products/NET/Controls/WinForms/Wizard/

  2. A home-grown wizards framework: http://weblogs.asp.net/justin_rogers/articles/60155.aspx 自制的向导框架: http//weblogs.asp.net/justin_rogers/articles/60155.aspx

  3. A wizard framework by Shawn Wildermut part of the Chris Sells's Genghis framework: http://www.sellsbrothers.com/tools/genghis/ Shawn Wildermut的向导框架是Chris Sells的Genghis框架的一部分: http//www.ussellsbrothers.com/tools/genghis/

Take a look at this article on MSDN about "inductive user interfaces". 在MSDN上查看关于“归纳用户界面”的这篇文章 It describes a framework (and provides the code to download) based on UserControls that give you "navigation" within a form. 它描述了一个基于UserControls的框架(并提供了下载代码),可以在表单中提供“导航”。 Perfect for designing wizards. 完美的设计向导。

The easiest way to create a wizard dialog is to use one of the third-party versions available that handle all of the "hard stuff" (the page navigation, UI framework, etc.) for you. 创建向导对话框的最简单方法是使用一个可用的第三方版本来处理所有“硬件”(页面导航,UI框架等)。 The one I like the most is from Divelements ; 我最喜欢的是来自Divelements ; they have both a WinForms and a WPF version. 他们有WinForms和WPF版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM