.NET / Windows App, Multiple Forms / Windows...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VG9kZCBKYXNwZXJz?=

    .NET / Windows App, Multiple Forms / Windows...



    Hey guys, really dumb question here... I've been doing all of my development
    in the past few years as web applications. Therefore, if I need a new window
    or form, I simply have it go to another page. I haven't written a Visual C++
    or VB (or Delphi) application in at least 4 years and for the life of me, I
    don't remember how to go from one window to the next. What I mean is, lets
    say I have a main menu with buttons on it. Someone clicks one of the buttons,
    I want the main window to dissapear and the new window (with new options) to
    open. I know each window is a "form.cs".. . how do I make that "call" to tell
    the new window to open. I'm assuming of course I don't automatically just
    OPEN all the forms at the same time and just hide them.



    I know this is really lame, but any help would be appreciated.





    Thanks!!!



    Todd

  • Thom Little

    #2
    Re: .NET / Windows App, Multiple Forms / Windows...

    In the "handler" use ...

    frmAbout frm = new frmAbout();
    frm.Show();

    .... to display the frm with the name frmAbout.

    .... Thom
    _______________ _______________ _______________ ______
    Thom Little - www.tlanet.net - Thom Little Associates, Ltd.

    Comment

    • Peter Morris

      #3
      Re: .NET / Windows App, Multiple Forms / Windows...

      Or try ShowDialog()


      Comment

      • Thom Little

        #4
        Re: .NET / Windows App, Multiple Forms / Windows...

        The first time I use ...
        ShowDalog( frmAbout( ) );
        .... from a MDI form it throws an error with ...
        Additional information: Form that is already visible cannot be displayed as
        a modal dialog box. Set the form's visible property to false before calling
        showDialog.

        If I instead use ...
        frmAbout frm = new frmAbout();
        frm.Show();
        .... it succeeds.

        Suggestion?

        .... Thom
        _______________ _______________ _______________ ______
        Thom Little - www.tlanet.net - Thom Little Associates, Ltd.

        Comment

        • =?Utf-8?B?VG9kZCBKYXNwZXJz?=

          #5
          Re: .NET / Windows App, Multiple Forms / Windows...


          Thanks guys! I appreciate the responses!

          Comment

          Working...