?
Solved

Open/close forms in winforms c#

Posted on 2008-10-21
2
Medium Priority
?
2,936 Views
Last Modified: 2013-12-17
Hi I am new to winforms programming most experience is web forms.

How Do I open another form from a button and the close the current form with a button?

So I have
    private void btnStreets_Click(object sender, EventArgs e)
    {
         Code to open or close a form here?

    }
0
Comment
Question by:Charles Baldo
[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 Comments
 
LVL 5

Accepted Solution

by:
jfmador earned 2000 total points
ID: 22772828
to close you simple need to call Close(); or this.Close();

to open a new one name frmTest1

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

or

frm.ShowDialog(); to open it as Modal (you cannot acces other windows of this application since this form is close)
0
 

Author Closing Comment

by:Charles Baldo
ID: 31508578
Thanks
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

771 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