Dev waits for a message indicating another version of waitdialogform

Source: Internet
Author: User

I. Dev wait prompt box

All users who have used devexpress know that Dev comes with the default wait progress prompt box, the effect is as follows:

Simple code:

Waitdialogform SDF = new waitdialogform ("prompt", "logging on ......");
For (Int J = 1; j <I; j ++)
{
Thread. Sleep (3000 );
SDF. setcaption ("execution progress (" + J. tostring () + "/" + I. tostring () + ")");
}
SDF. Close ();

I added a three-second wait time in the middle. Otherwise, the prompt box will flash too fast.

When creating an object, we bring two parameters. Of course, there are other more parameters. You can set the font and wait for the image to be set.

2. Prompt box for another edition I changed

First, let's take a look at the effect:

I changed the "Dev wait image" to "progressbarcontrol" to better display the progress. I renamed the form showdialogform.

In order to see the effect, I added a loop to display the execution progress, and used a progress bar to show the friendly prompt. If a large number of databases are encountered, this loop is not required.

Simple code:

Int I = 1999;
Showdialogform SDF = new showdialogform ("prompt", "logging on...", "Please be patient and verify your identity! ", I );
For (Int J = 1; j <I; j ++)
{
SDF. setcaption ("execution progress (" + J. tostring () + "/" + I. tostring () + ")");
}
Login ();
SDF. Close ();

 

Main Code of showdialogform waiting for the form:

/// <Summary>
/// Set
/// </Summary>
/// <Param name = "_ caption"> prompt </param>
/// <Param name = "_ message"> message content </param>
/// <Param name = "_ content"> detailed description </param>
/// <Param name = "_ maxprocess"> maximum progress bar value </param>
Public showdialogform (string _ caption, string _ message, string _ content, int _ maxprocess)
: This ()
{
This. Caption = "";
This. Message = "";
This. content = "";

This. Caption = _ caption = ""? "Prompt": _ Caption;
This. Message = _ message = ""? "Loading. Please wait...": _ message;
This. content = _ content;
This. maxprocess = _ maxprocess> This. minprocess? _ Maxprocess: minprocess;

Lblcaption. Text = This. Caption;
Lblmessage. Text = This. message;
Lblcontent. Text = This. content;
Progressshow. properties. Minimum = minprocess;
Progressshow. properties. Maximum = maxprocess;
Progressshow. properties. Step = 1;
Progressshow. Progress mstep ();

This. showintaskbar = false;
This. topmost = true;
This. Show ();
This. Refresh ();
}

 

It is best to attach the whole showdialogform to wait for the form File

Click to download

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.