Solved

Windows Forms

Posted on 2004-04-26
2
202 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
  • 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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