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