using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ch15_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton2.Checked == true)
                tabControl1.Appearance = TabAppearance.Buttons;
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                tabControl1.Alignment = TabAlignment.Left;
            }
            else
            {
                tabControl1.Alignment = TabAlignment.Top;
            }
        }

        private void radioButton1_CheckedChanged_1(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
                tabControl1.Appearance = TabAppearance.Normal;
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton3.Checked == true)
                tabControl1.Appearance = TabAppearance.FlatButtons;
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            int size = (int)numericUpDown1.Value;
            string font = listBox1.Font.Name;
            listBox1.Font = new Font(font, size);
            listBox2.Font = new Font(font, size);
            richTextBox1.Font = new Font(font, size);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Interval = 10;
            timer1.Start();
            toolTip1.Active = true;
            toolTip1.AutomaticDelay = 200;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            System.DateTime time ;
            time = DateTime .Now ;
            int h = time.Hour;
            int m = time.Minute;
            int s = time.Second;
            this.Text = "Time is : " + h.ToString() + ":" + m.ToString() + ":" + s.ToString();
        }
    }
}
