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

namespace ThemeManager
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void btnCloneForm_Click(object sender, EventArgs e)
        {
            var f2 = new Form2();
            f2.SetDesktopLocation(this.DesktopBounds.Left + 20, this.DesktopBounds.Top + 20);
            f2.Show();
        }

        /// <summary>
        /// Event fired when a theme on an object managed by a theme controller has changed.
        /// We use this event to ensure that even if the theme specifies a font for C1Label,
        /// the size of the font on our label stays 12.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void c1ThemeController1_ObjectThemeApplied(C1.Win.C1Themes.C1ThemeController sender, C1.Win.C1Themes.ObjectThemeEventArgs e)
        {
            if (e.Object == this.c1Label1)
                this.c1Label1.Font = new Font(this.c1Label1.Font.FontFamily, 12);
        }
    }
}
