Reputation: 548
I need to simulate a form that is similar to the interface seen during installation of any software. There are next and back buttons and the all the information entered by the user is processed only when he/she clicks the finish button.
When the user clicks the back button, the previous entered information is showed to him/her.
When the user clicks the next button the next screen is show to him/her. All displayed information is shown in one form.
There are 3 section which I need to show the user.
Currently planning to implement the solution listed below :
Are there any better solution than the one describe above. If yes, please describe the approach. Any help provided will be greatly appreciated.
Upvotes: 6
Views: 488
Reputation: 3937
Yeah, like iain said, the wizard control is probably your best bet, but if that doesn't work, try looking for MultiView or Accordian controls. They make controls that are specifically for hiding/showing sections on a form, so you don't have to go from form to form, and thus you stay in the same scope the whole time. Makes keeping the fields populated a lot easier.
Upvotes: 0
Reputation: 595
One way to achieve this is using a tab control and hiding the tabs so that the user can't navigate between them and instead you control moving from one tab to the next programatically.
I use the KryptonNavigator control as it provides many different modes that make it simple to hide tabs so that only tab content is visible, etc. However, it should be possible to hide the tabs of the standard tab control.
Upvotes: 2
Reputation: 4330
You could create custom controls for the three different screens, then you could just add those 3 controls to the form, making it easier to hide/show the appropriate controls.
Or alternatively, you can create three separate forms, and then show your forms in order and perform the actions in the programs Main()
function rather than using a form as your startup object. Like
static void Main()
{
Form1 f1 = new Form1();
if (f1.ShowDialog() == DialogResult.OK)
{
// do actions
// show next form
// etc.
}
}
Upvotes: 0
Reputation: 2550
Sounds like you need a wizard control. Try one of these:
http://www.codeproject.com/KB/miscctrl/ak_wizard.aspx
https://stackoverflow.com/questions/195255/best-wizard-control-for-net-windows-forms
Upvotes: 2
Reputation: 1
You can use usercontrol structure to achieve this kind of behaviour. You can add a simple panel control and change the content of the panel according to the buttons pressed. You can simply change the content of the panel by using yourPanel.Controls.Add(your_user_control)
.
So different control sets can be implemented on a winform.
Thanks
Upvotes: 0