C, how can the hidden main window be displayed?

Updated on technology 2024-02-08
27 answers
  1. Anonymous users2024-02-05

    You can pass the main window as a parameter to a child window.

    **As follows: Main Window:

    public partial class frmmain : form

    public static frmmain f0 = null;Used to refer to the main window.

    public frmmain()

    initializecomponent();

    f0 = this;Assignment.

    private void button1_click(object sender, eventargs e)

    new frmcx().show();

    Sub-window: Public Partial Class FRMCX : form

    public frmcx()

    initializecomponent();

    private void frmcx_formclosing(object sender, formclosingeventargs e)

    The main window is displayed.

  2. Anonymous users2024-02-04

    Your main window is from1, if so, it's new from1()show();That's it, what you do is a winfrom program, and the name of the form is what you call from2 and from1, so the class name of your form is from2 and from1, and you can instantiate the object with the class, so you understand?

  3. Anonymous users2024-02-03

    Add a member variable of type form1, p frm, to form2

    Make = form1

    Then p

  4. Anonymous users2024-02-02

    Directly under the button in form2.

    form1 f3=new form1();

    Then you click on the button form1 and it comes out.

  5. Anonymous users2024-02-01

    According to the upstairs method, you can call show by passing form1 to form2, but in fact, this is not a good method, if you forget to return to form1 in form2, and close form2 directly, then form1 will permanently reside in memory (unless closed with task manager), it is better to use mdi, or make it in the form of control loading.

  6. Anonymous users2024-01-31

    Constructor.

    Button Click event in form1: private void button1 click(object sender, eventargs e).

    form2**:

    form f1 = new form1();

    form2 construction.

    public form2(form1 firstform) form2 button click eventprivate void button1 click(object sender, eventargs e).

  7. Anonymous users2024-01-30

    Pass form1 as a parameter to form2, for example, when displaying form2;

    When clicking on the button: ;;

  8. Anonymous users2024-01-29

    Well, that's fine, form 1:

    public form1()

    Button event for Form 1.

    private void button1_click(object sender, eventargs e)

    Form 2: form1 f1 = null;

    public form2 (form1 f) Close button event for Form 2.

    private void button1_click(object sender, eventargs e)

    Give it a try

  9. Anonymous users2024-01-28

    When you open a new form2, you will hide the original form1

    form2 fm = new form2(this);It feels like it's actually a parameter to pass in and pass the current main form to enter.

    Hide this window now.

    A new window appears.

    When closing a new form2, the original form1, public partial class, form2: form, is displayed

    Add form2 formclosing event to form2.

    private void form2_formclosing(object sender, formclosingeventargs e)

    I promise that I can, because I just checked the information and got the result like this, Meizizi

  10. Anonymous users2024-01-27

    Well. I see what you're talking about.

    Let's take an example.

    For example, there are two forms, form1 and form2

    To do this, click a button in form2 to make form1, which has been hidden, appear.

    It can be done like this.

    Add a public static form variable to class form1. Make him equal to the current form:

    Here's how: public static form f;

    Then in the constructor of form1 it is written like this:

    public form1()

    Next. You can hide or show form1 by manipulating it in class form2.

    If there's anything you don't understand, you can ask me. Hey.

  11. Anonymous users2024-01-26

    Change its disable property to make the already hidden form visible

  12. Anonymous users2024-01-25

    It would be nice to change the visible property of its widget to true.

  13. Anonymous users2024-01-24

    It should be written like this:

    Parent form's key event.

    form1 f = new form1();

    dialogresult d = ;

    if(d ==

    true;The key event of the subform.

    form1 is changed to its own parent form name.

    form2 is changed to its own subform name.

    It's a habit to come back and like it.

  14. Anonymous users2024-01-23

    You can use the following methods to show the parent form that has been hidden:

    Use the modal dialog showdialog().

    Returns = dialogresultValue;

    Main form keys**:

    form1 f = new form1();

    dialogresult d = ;

    if(d == dialogresult.value) = true;

  15. Anonymous users2024-01-22

    It's very simple: write the parent's visible=true in the child form's closing event; That's it,

  16. Anonymous users2024-01-21

    In the close event of the form, the open parent form event is raised, which causes the form to reappear in the event.

  17. Anonymous users2024-01-20

    Parent window:

    form form2 = new form():

    this;Subwindow: Change the capitalization yourself.

  18. Anonymous users2024-01-19

    In the closing event of the subform,;

  19. Anonymous users2024-01-18

    Set the visible property of the form to true

  20. Anonymous users2024-01-17

    Upstairs is OK, and you can set the visible property of the form to true.

  21. Anonymous users2024-01-16

    When the form loads, execute; methods or use attributes; , so that the form can be hidden when the program starts.

  22. Anonymous users2024-01-15

    Is it a landing form?

    Perform the close statement after hiding and waiting for the subform to be used.

    form2 frm2=new form2();

    Hide the parent form first.

    Display the subform.

    Wait for the subform to be used and then execute the close statement;

  23. Anonymous users2024-01-14

    Eject the child form while hiding the parent form.

    Subform. fm=new subform();

  24. Anonymous users2024-01-13

    1. The first solution:

    Form A itself controls whether it is hidden or not. Add the following ** to the button event.

    false;

    form2 f2 = new form2();

    Not available here;

    true;After form2 is closed, the second solution of this statement 2 and the second solution will be executed

    Form B controls whether A is hidden or not.

    This requires form1 to pass itself as a parameter to form2, which is controlled by form2 execution.

    Define a new display method in form2.

    from fm = null;Used to store form1 variables public void showme(form f)fm = f;

    false;Hide form1.

    show();

    Add ** to the formclose event in form2.

    true;Let form1 show.

    Finally, there is the ** in the button event of form1.

    form2 f2 = new form2();

    Note: There are other ways to solve this problem. Such as the use of event processing mechanisms, etc.

  25. Anonymous users2024-01-12

    There are two ways to do this.

    One is to hide, it seems to be written like this, anyway, it's a method that starts with h, this is to hide the form, and when you close the form b, you need to show the form a

    Just use it...

    Another way to do this is to close form A and open form b, which is then in the startup settings.

    Plus when when A is turned off, when B is turned off, then when B is closed, it is still used to open A....

  26. Anonymous users2024-01-11

    Use the event to close the window.

    Take a closer look.

    When window B closes.

    form a=new form();

    Because A is the main window.

    So it is hidden.

  27. Anonymous users2024-01-10

    You can write it in the back.

Related questions
3 answers2024-02-08

The fastest - the answer is answered.

If you want to do it for a short time, you can do the rookie task - 20 Fortune. >>>More

18 answers2024-02-08

Is your "2012-07-23" a field? If you can directly use the substitution function to replace the year, month and day with "-", it will save trouble.

8 answers2024-02-08

Your anomaly was triggered, but it was eaten.

Because the using statement is actually try....Finally, your ** is equivalent to. >>>More

11 answers2024-02-08

First of all, it is necessary to understand what a binary tree is (and I guess the subject also understands). >>>More