Solved

Open/close forms in winforms c#

Posted on 2008-10-21
2
2,920 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now