CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011

    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?


  2. #2
    Join Date
    Apr 2011

    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:
    FormName 1name = new FormName();;
    Form2 opf2 = new Form2();; // this open you new window, but you still have Form1 too..
    if you want like dialog use.
    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 "
    Login lf = new Login();
    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

Click Here to Expand Forum to Full Width