Solved

Open/close forms in winforms c#

Posted on 2008-10-21
2
2,924 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:charlesbaldo
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:charlesbaldo
ID: 31508578
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

810 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