Solved

Open/close forms in winforms c#

Posted on 2008-10-21
2
2,931 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 500 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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

717 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