C How to use the close button at the top right of the form

Updated on healthy 2024-05-23
6 answers
  1. Anonymous users2024-02-11

    This question is simple, I will give you the original **.

    namespace windowsapplication2public partial class form1 : formpublic form1()

    initializecomponent();

    formclosingevent.

    private void form1_formclosing(object sender, formclosingeventargs e)

    A pop-up prompt box is used for messageboxbuttons. yesnoif ("Confirm closing? ", "Tips", ,== Click Yes to close the form.

    false;

    else click No, the form is not closed.

    true;Here is the formclosing event of the form, and e is the parameter in this method (automatically generated)!

  2. Anonymous users2024-02-10

    Check out the event! It seems to be a formclosing event.

    Then use a messagebox.

  3. Anonymous users2024-02-09

    Write a tooltip in the closing event of the form. If the user clicks No then cancel the closure.

  4. Anonymous users2024-02-08

    Click on the form.

    Find the formclosing event inside the event.

    Then enter these:

    dialogresult restlt = "Whether or not to turn it off", "Tips", ,if (restlt ==

    false;

    true;

  5. Anonymous users2024-02-07

    form_close()

    time to add a messagebox, and depending on the situation returned, make a yes or a cancel

    Assassin.

  6. Anonymous users2024-02-06

    1. First of all, we open the properties of the sub-window, click on the "lightning icon (framed in the picture below)" to find the formclosing (or formclosed) event, and double-click.

    2. In the gameui formclosing event**.

    <>4、;If you just close the current window, you can't exit the program if it's not the main form, and if you have a managed thread (not the main thread), you can't exit cleanly.

    5、;Force all messages to abort and exit all forms, but if there is a managed thread (not the main thread), it will not be able to exit cleanly.

    6、;Forcibly aborting all messages on the calling thread also faces the problem that other threads cannot exit correctly.

    7、;This is the most thorough way to exit, no matter what thread is forced to quit, and the program ends cleanly.

Related questions
13 answers2024-05-23

I don't know if net has this kind of control or has the function itself, if you want to write it yourself, it is to detect whether the program form is outside the screen, that is, whether the y coordinate is less than 0 and so on; It will be displayed if the mouse cursor is moving over it.

8 answers2024-05-23

The overall idea is to set both the A and B forms as global variables, so that they can access each other. >>>More

17 answers2024-05-23

form1**:

using system; >>>More

12 answers2024-05-23

There's a function. There is a sqrt function below, for example, if you want to open a square of 4, you can use it; >>>More

4 answers2024-05-23

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