This example uses three forms:
|
Show
shows the form with the specified owner to the user,
Hide
hides a form object, and
Exit
exits the application.
using System; using System.Windows.Forms; namespace WindowsFormsApp4 { public partial class Home : Form { public Home( ) { InitializeComponent( ); } private void Button1_Click( object sender, EventArgs e ) { if ( radioButton1.Checked ) { Form f = new Happy( ); f.Show( ); this.Hide( ); } else { Form f = new Frown( ); f.Show( ); this.Hide( ); } } private void Button2_Click( object sender, EventArgs e ) { Application.Exit( ); } } } |