Building a multi-step wizard interface using the Wizardcontrol control in DevExpress

Source: Internet
Author: User

The use of good interface control, often can be made to compare the interface experience effect. In some interface operations, we may split it into several processing, this time to introduce the Wizardcontrol Wizard control should be a good choice. Multi-step processing mode, can let users avoid a one-time input too much content irritability mood, can also be targeted to verify part of the content, this article to use the Wizardcontrol control to design the results of password recovery to introduce, Gives you a general idea of the use of the DevExpress-based Wizardcontrol Wizard control.

1, the interface effect planning

In the General app or web-based software interface, there is a function to help users recover account password, you can let users self-help through mobile phone, mail, etc. to get the password to recharge the opportunity. such as the General app interface effect is shown below.

But the general WinForm interface, you can use the wizard control to do better, where the DevExpress Wizardcontrol Wizard control is a good choice.

We usually find the corresponding Wizardcontrol Wizard control by selecting the Navigation Layout tab in DevExpress's vs toolbar.

Finally, the effect we achieve is as follows.

2. Control usage and code handling

As described above, you can find the corresponding Wizardcontrol Wizard control by choosing the Navigation Layout tab in the DevExpress vs toolbar.

We can drag this control to a blank form interface and see the default interface, where we can see a full wizard interface effect.

The controls that are dragged over, the initialization interface effect is in English, you can modify the text in the control properties.

The modified interface effect is shown below.

Then we modify some of the wizard control properties, slices, text and other content, and finally in the blank position, drag into some interface controls, to achieve our interface effect.

In addition, the default Wizard control is three interface pages, so we can add or remove some as needed, as in this case I removed one, just use two pages to handle the password retrieval process.

In addition, in order to implement the input validation and processing of the interface of the wizard control, we often need to deal with the next step, completion, cancellation, help and other events, so as to achieve better processing effect.

Some of the processing code is shown below.

        Private voidWizardcontrol1_nextclick (Objectsender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e) {            stringPagetext =E.page.text; if(Pagetext = ="Verify your account")            {                if( This. TxtMobile.Text.Length = =0|| This. TxtValidateCode.Text.Length = =0) {messagedxutil.showtips ("Please enter your mobile phone number and verification code"); e.handled = true;  This. Txtvalidatecode.focus (); return; }                Else if(! Validateutil.isvalidmobile ( This. Txtmobile.text)) {Messagedxutil.showtips ("Please enter the correct mobile phone number"); e.handled = true;  This. Txtmobile.focus (); return; }                Else                {                    BOOLresult = Callerfactory<ismscodeservice>. Instance.checksmscode ( This. Txtmobile.text, This. Txtvalidatecode.text); if(!result) {Messagedxutil.showtips ("Verify that the verification code is not correct, please check if the verification code is within the valid time. ");  This. Txtvalidatecode.focus (); return; E.handled=true; }                }            }            Else if(Pagetext = ="Reset Password") {messagedxutil.showtips (pagetext); }        }

In these next steps, there is a code that needs to block the next step of processing.

true;

So that we can implement the user input validation processing, if the processing does not pass, then stay on this page, so that users can correct the input.

If it is the finished button page, it is also the same processing.

        Private voidWizardcontrol1_finishclick (Objectsender, CancelEventArgs e) {            if( This. TxtCorpAccount.Text.Length = =0)            {                 This. Txtcorpaccount.focus (); Messagedxutil.showtips ("The company account cannot be empty! "); E.cancel = true; return; }            Else if( This. TxtNewPassword.Text.Length = =0)            {                 This. Txtnewpassword.focus (); Messagedxutil.showtips ("The password cannot be empty! "); E.cancel = true; return; }            Else if(! This. TxtNewPassword.Text.Equals ( This. Txtrepassword.text)) {                 This. Txtrepassword.focus (); Messagedxutil.showtips ("two times the password is inconsistent! "); E.cancel=true; return; }          ...............

In the end, we achieved the same effect as we said before.

Combined with the SMS platform, we can send the user verification code and prompt message.

Building a multi-step wizard interface using the Wizardcontrol control in DevExpress

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.