Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Menustrip question

pnrpnr Member Posts: 1
Hi I'm new here and new to winforms. I'm a ASP.Net developer and finding Winforms very different.

The question I have is how do you link from one form to another. I see there is a Menustrip object and LinkLabel but I don't see anywhere you can reference another form.

For example in ASP.Net you would reference a different WebForm using a hyperlink.

Please help. Thanks.

Comments

  • aspongeasponge Member Posts: 42
    : Hi I'm new here and new to winforms. I'm a ASP.Net developer and
    : finding Winforms very different.
    :
    : The question I have is how do you link from one form to another. I
    : see there is a Menustrip object and LinkLabel but I don't see
    : anywhere you can reference another form.
    :
    : For example in ASP.Net you would reference a different WebForm using
    : a hyperlink.
    :
    : Please help. Thanks.
    :
    As you're discovering a Winforms application is very different from an ASP.NET application. To open a new form from a current form you need to instantiate the form object and "show" it.
    [code]
    MyForm f = new MyForm();
    f.Show();
    [/code]
    The reference to the "f" variable above however exists in the original calling form. Opening new forms is not quite like changing web pages. If you need multiple forms you can use the menustrip and open multiple forms on the menu click events.

    Your question is fairly vague, so if there is a specific circumstance wherein you need to jump from form to form, then an explanation of that scenario may help in getting you to your goal.

Sign In or Register to comment.