Zebra0.com

csharp dialogs


Text of video

Write the code as shown below:

   public partial class Form1 : Form
    {
        // These variables will be used to restore the original state.
        Font startFont;
        Color startColor;
        public Form1()
        {
            InitializeComponent();
            // Store the current font and color.
            startFont = lblHappy.Font;
            startColor = this.BackColor;
        }

        private void mnuExit_Click(object sender, EventArgs e)
        {
            // Closing the form closes the app.
            this.Close();
        }
Complete code for Happy Birthday app

End of lesson, Next lesson: forms in C#