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

using Microsoft.WindowsCE.Forms;

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

            #if DEBUG
                MinimizeBox = false;
            #else
                MinimizeBox = true;
            #endif

        }

        private void butGetTime_Click(object sender, EventArgs e)
        {
            txtCurTime.Text = DateTime.Now.ToLongTimeString();
        }

        private void txtCurTime_KeyPress(object sender, KeyPressEventArgs e)
        {
            if(Char.IsLetter(e.KeyChar))
                {
                    // сохраняем текущую позицию каретки
                    int pos = txtCurTime.SelectionStart;
 
                    // переводим в верхний регистр
                    txtCurTime.Text = txtCurTime.Text.Insert(txtCurTime.SelectionStart, Char.ToUpper(e.KeyChar).ToString());
 
                    // перемещаем каретку в новую позицию
                    txtCurTime.SelectionStart = pos + 1;
                    e.Handled = true;
                 }
       }

        private void butClearType_Click(object sender, EventArgs e)
        {
            LogFont lf = new LogFont();
            lf.FaceName = "Tahoma";
            lf.Height = 116;
            lf.Quality = LogFontQuality.ClearType;
            lblBigFont.Font = Font.FromLogFont(lf);
        }

       
    }
}