Open another window
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Open another window

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Posts
    1

    Question Open another window

    Ello Codeguru
    I'm relatively new to GUIs and I ran into a problem:

    I have in Visual Studio 2010 created 2 simple windows forms in a project.
    On the first form I added a button which has the function of opening the next window.
    ...

    That's it. That's all I need right now.
    Anyone know what to write / use to make this work?

    I looked into "AccessibleRole" but I can't find anything to link the button and the other form / window.

    Am I looking the wrong place?

    Regards
    Limro

  2. #2
    Join Date
    Apr 2011
    Posts
    1

    Re: Open another window

    About C++ Idk, my knowledge is low and i have only work in console mode.

    i can say you about C#, its about same in C++... just try...

    well lets say you have 2 forms, Form1 and Form2

    Form1 is you main form, and you wanna call Form2 using a buton or whatever.

    code is:
    Code:
    FormName 1name = new FormName();
    1name.show();
    example
    Code:
    Form2 opf2 = new Form2(); 
    opf2.show(); // this open you new window, but you still have Form1 too..
    if you want like dialog use.
    Code:
    Form2 opf2 = new Form2();
    opf2.showDialog(); // this open you new window, and you dont have acces in Form1, you must close it.
    Example , lets say you wanna make simple login, Main Form + Login Form...
    And you wanna to get access in main form only if put right password.

    well you will put on Main Form, on event " ON Laod "
    Code:
    Login lf = new Login();
    lf.showDialog();
    as i say using that you must enter right pass to have acces main form...

    Soz for myh bad english...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center