c Double click on the form in the form to get the Form1 Load, but how to get the Form1 Paint

Updated on society 2024-05-15
29 answers
  1. Anonymous users2024-02-10

    Check this out. <>

    You can also knock ** yourself.

    painteventhandler(form1_paint);

    void form1_paint(object sender, painteventargs e)

    Yours**.

  2. Anonymous users2024-02-09

    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();

  3. Anonymous users2024-02-08

    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.

  4. Anonymous users2024-02-07

    There is an Event tab in the property bar where you can find the event.

  5. Anonymous users2024-02-06

    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.

  6. Anonymous users2024-02-05

    Confirm that the form1 load function is bound to the form load event, as shown below

    form1_load

  7. Anonymous users2024-02-04

    Double-click on the form and write it in the generated **.

  8. Anonymous users2024-02-03

    The load event was not triggered at all.

  9. Anonymous users2024-02-02

    You first double-click on the form to see if it is associated with the form1 load event you are referring to.

  10. Anonymous users2024-02-01

    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";

  11. Anonymous users2024-01-31

    Refresh the form written in one.

    private void refresh(), after clicking the button, just execute refresh().

  12. Anonymous users2024-01-30

    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 ==

  13. Anonymous users2024-01-29

    Turn it off and on again, that refresh doesn't work.

  14. Anonymous users2024-01-28

    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.

  15. Anonymous users2024-01-27

    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.。

  16. Anonymous users2024-01-26

    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.

  17. Anonymous users2024-01-25

    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.

  18. Anonymous users2024-01-24

    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.

  19. Anonymous users2024-01-23

    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.

  20. Anonymous users2024-01-22

    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.

  21. Anonymous users2024-01-21

    You check the enable properties of the listbox and groupbox!!

  22. Anonymous users2024-01-20

    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.

  23. Anonymous users2024-01-19

    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.

  24. Anonymous users2024-01-18

    form1 load() is executed when the runtime window is loaded.

    button1 click().

  25. Anonymous users2024-01-17

    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.

  26. Anonymous users2024-01-16

    What is the question about that event, if you want to do something, call (execute) the corresponding function?

  27. Anonymous users2024-01-15

    Whatever you want to achieve by clicking on the button, write what you want to do in it

  28. Anonymous users2024-01-14

    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.

  29. Anonymous users2024-01-13

    Are you saying that you put other people's good forms into your own program? That doesn't matter, use the same.

Related questions
9 answers2024-05-15

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

4 answers2024-05-15

Your form2 constructor should be overloaded once: it should pass the textbox as an argument and it becomes: >>>More

22 answers2024-05-15

Register the keypress event for this textbox.

new ; >>>More

24 answers2024-05-15

The easiest way to do this is to create a constructor with a string parameter in form2, and then generate a form2 form. >>>More

19 answers2024-05-15

Write in the click of button1; Then write using system in the main function; >>>More