When a project was created for a while, it took a long time to process the report. The customer proposed to make a wait window prompting the user to wait (the page was not reflected for too long, and the user thought it was dead ). After analyzing this requirement, I felt that it would be too difficult to implement processbar IN A winform application. Finally, I had to simulate a "fake" Wait form. Fortunately, the customer was quite satisfied.
This wait form is actually completed using the <object> tag. Because the dynamic effect is completed by <marquee>, when the form is displayed, the entire table is transparent, and only the intermediate process bar is moving. No button can be clicked at the end.
First, create a static page: downloadExcel.html
Generating the report. Please wait... |
|
|
|
|
Then add the following paragraph to the processing screen:
<TABLE border = "0" id = "processBarMask" bgcolor = "# cccccc" style = "VISIBILITY: hidden; POSITION: absolute" cellspacing = "0" cellpadding = "0">
<TR>
<TD align = "center">
<Object type = "text/x-scriptlet" id = "objProcessBar" style = "z-index: 65535; "width =" 302 "height =" 102 "data =" downloadExcel.html "> </object>
</TD>
</TR>
</TABLE>
It is hidden from the beginning. After you click the processing button, it is displayed as follows:
<SCRIPT language = "javaScript">
Var firstFlg = "0 ";
Function processStart (){
With (document. all. processBarMask. style ){
Top = 0;
Width = "100% ";
Height = "100% ";
Visibility = "visible ";
}
Document. all. processBarMask. focus ();
}
Function processEnd (){
Document. all. processBarMask. style. visibility = "hidden ";
}
</SCRIPT>
Add processing to the processing button:
<Input type = "button" id = "btnOK" value = "OK" onclick = "processStart ()" style = "width: 80px">