-
Check this out. <>
You can also knock ** yourself.
painteventhandler(form1_paint);
void form1_paint(object sender, painteventargs e)
Yours**.
-
There are several ways to do this:
1. Through the [Design] window, select the form, open the [Properties] window, there is a lightning bolt icon at the top, that is the event, find paint, double-click the content behind it, that is, complete the creation of the event.
2. It can also be written by **.
painteventhandler(form1_paint);
void form1_paint(object sender, painteventargs e)
throw new notimplementedexception();
-
There is a lightning bolt icon in the form properties bar, which contains a variety of events for him, and the name can be added by yourself, or you can double-click on this event to automatically generate it.
-
There is an Event tab in the property bar where you can find the event.
-
Landlord,You create a new winform application,Then double-click the top border of the form,Then there will be a load event,Write ** in it.,If not, check the file.,Is there a load event.。 It's okay to not add it.
-
Confirm that the form1 load function is bound to the form load event, as shown below
form1_load
-
Double-click on the form and write it in the generated **.
-
The load event was not triggered at all.
-
You first double-click on the form to see if it is associated with the form1 load event you are referring to.
-
It can be achieved. /
Button click event: Create a thread.
Zhonghe Brigade Private Void Button1 Click(Object Sender, Eventargs E).
send = sender;
args=e;
thread mythread = new thread(new threadstart(painform));Create a thread instance.
true;Sell Stool Threads set the stool as a background thread.
private object send;Parameter 1
private eventargs args;Parameter 2
Threads that periodically call the form paint event.
private void painform()
while (true)
In the thread, form1 paint() is called every 5 seconds
form1_paint(send, args);
form's paint event.
private void form1_paint(object sender, eventargs e)
paint event");
paint event";
-
Refresh the form written in one.
private void refresh(), after clicking the button, just execute refresh().
-
I think you want to refresh it after clicking on it, and receive the value of the messagebox, dialogresult dr="You want? ", system prompt! ",;
if (dr ==
-
Turn it off and on again, that refresh doesn't work.
-
The effect that may be achieved is the same, but there is an essential difference between the two of them.
public form1(): This is the constructor of the form, form1 load is the event that is triggered when the form is loaded, for example, you want to get some information from the data after the form is opened, and then fill it in the form.
If you write init in public form1()....In front of the method, at this time, there are no controls in the form, and an error will be reported.
But writing to the form load is fine, because the form (all the classes) must be constructed first, and then some event (or method) will be executed.
The form is also a class, public form1() is when you write a statement form1 f1=new form1(); new form1().
No matter how specific it is, you need to understand it yourself.
-
The ** in the former is just equivalent to a container, and the conditions for execution can be varied, such as triggering with a button, or judging the input value, etc., and even writing the function name in the back to execute.
The ** in the back is executed when this window is opened.,For example, some default settings of information should be placed here.。
-
In fact, your understanding is wrong. form1 is actually a constructor of a class. This class inherits from the class because it is developed by form, and the form1 load is just an event of this class.
The two appear in different life cycles, and are generally written in different places according to the situation of **. In other words, the former is just a constructor of a class, and the child control is generally written into it, and then initialized in init. The load event is automatically triggered when the form is loaded, and you can generally write some initialization presences, etc.
Although it is not limited to the specific location you write, in general, the child control should be written to the construct or written to the init event, and the load event is to handle some events after the load is completed. If the child control is loaded asynchronously and so on.
-
Good question.
public form1(): is a declaration of the class.
form1 load: is a load event of the form, my understanding is that the execution time is different, form1() is executed first. And what is written is also different.
-
public form1(): is the constructor of the class and is used to pass arguments.
form1 load(0: is the load event of the form, which is used to load data.
-
Right-click the mouse in your designer form, select Properties, click on the lightning bolt symbol in the top row in the properties window (there is a prompt when you put the mouse on it), all of which are form1 events, and there are prompts under each selection, just look at it yourself, and the rest of the controls want to button (button), label (label) and other events are also found in this way, double click into only one default common event.
-
Point attributes, find a yellow symbol similar to thunder in the weather bulletin in the interactive interface, that is the behavior, and double-click there to open the corresponding **input window.
-
You check the enable properties of the listbox and groupbox!!
-
For example, if you want a dialog box to pop up when the window is opened, then you write it in the form load event, and if you want to pop up a dialog box by pressing the button button, then it will be written in the button click event, and there is no necessary connection between the two. It's just that the conditions under which it happens are different.
-
The event (function) triggered by the button is written in the button, and the function to be called by the form during initialization is written in the from load event.
-
form1 load() is executed when the runtime window is loaded.
button1 click().
-
What needs to be displayed or what needs to be done when your form is first opened, these operations are placed in the form load, and what you need to do when you click the button, this operation is placed in button1 click.
-
What is the question about that event, if you want to do something, call (execute) the corresponding function?
-
Whatever you want to achieve by clicking on the button, write what you want to do in it
-
For newly created projects, the default form1 form is created. You can copy the source code of Hengxiang's other people's form to the form1 window of the new project. You can get the value of the form that disturbs others.
-
Are you saying that you put other people's good forms into your own program? That doesn't matter, use the same.
GDI is like this, you can use any of the following methods I provide to alleviate this problem. 1. Before drawing this circle, draw a blue circle with a slightly lighter color, with a radius larger than your circle, so as to achieve the effect of blurring the edges, and add more circles (but the more the circle drawn before must have a slightly larger radius than the radius of the circle behind, and the color is slightly lighter), the better the effect. 2. Using WPF, this is not GDI but based on DX, which is more exquisite. >>>More
Your form2 constructor should be overloaded once: it should pass the textbox as an argument and it becomes: >>>More
Register the keypress event for this textbox.
new ; >>>More
The easiest way to do this is to create a constructor with a string parameter in form2, and then generate a form2 form. >>>More
Write in the click of button1; Then write using system in the main function; >>>More