Winform dialog box and winform
Public pop-up box help Operation Manual
1. Description
Some prompt boxes for winform operations are encapsulated, including prompts that the data is being loaded when the data loading time is elapsed. Please prompt the form later and dynamically prompt users with some useful information. For example, refer notifications in Internet cafes.
2. operation instructions
I. The normal bullet box prompt box is used for the feedback information after data loading or operation functions
Instance code:
// Display the pop-up box private void button2_Click (object sender, EventArgs e) {ViewHelper. BeginLoading ("hello, everyone! ");} // Close the pop-up box private void button4_Click (object sender, EventArgs e) {ViewHelper. closeLoading () ;}// the pop-up prompt box private void button3_Click (object sender, EventArgs e) {ViewHelper. showAutoCloseMsg ("operation successful! ") ;}// Error prompt box private void button5_Click (object sender, EventArgs e) {try {int a = 1; int B = 0; int t = a/B ;} catch (Exception ex) {ViewHelper. showErrMsg ("error:", ex );}}
The above Code includes the use of the main functions.
How to use it? Create a winform project, add a form1 form, and reference the rabbit. core. dll file to call ViewHelper.
II. How to achieve dynamic bullet box effects.
This is more user-friendly, and dynamic images cannot be uploaded, so you don't have to read it.
How to use it? On the basis of the original project, add a form2 form, modify the form to inherit a class named Dynamic in dll, and add the following code in the constructor. The Code is as follows:
Public partial class Form2: DynamicForm {public Form2 () {InitializeComponent (); DynamicForm. SetDeskLocation (this); // ensure that the box is displayed based on the current subform (this }}
Then we can construct rich pop-up information on form2 based on our own needs, and then call it to display it. We will bring it up in the form1 button. The effect is to imagine that the balance in the lower right corner of the Internet cafe is insufficient.
The call code is as follows:
// Dynamic prompt box private void button#click (object sender, EventArgs e) {ViewHelper. dynamicPopbyRightDown <Form2> (2000); // 2000 indicates that the pop-up box disappears after 2 seconds}
All of them are as follows:
The bullet box is slowly rising from bottom up in the lower right corner.
Download rabbit. core. dll
Qq: 739462304, welcome to exchange technology