Solved

Windows Forms

Posted on 2004-04-26
2
205 Views
Last Modified: 2010-04-15
Hi as real newbie to C# im in need of help on a basic question,

Ive created a windows form, and have created a button on that form but on the click event i want to open another form I have called frmMainmenu.

-
DW
0
Comment
Question by:back2back
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 4

Expert Comment

by:Jarodtweiss
ID: 10916699
You have to create an handler that will have that signature :

private void Button1_Click(object sender, System.EventArgs e)

and you have to associate that handler with the click event of the button (click on the button on design, go to the properties tab, display the events, locate the Click event and associate your handler)

Much more simpler, double click on your button : .NET will generate the code and association !
0
 
LVL 4

Accepted Solution

by:
Jarodtweiss earned 20 total points
ID: 10916702
To open a new form :

frmMainmenu myForm = new frmMainmenu();
myForm.ShowDialog();
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question