Caps Lock Kontrolü
Bu örnekte caps lock un açık olup olmadığını kontrol edeceğiz. Formunuzun keydown yordamına aşağıdaki kodları kopyalayınız.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualBasic.Devices;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
            this.KeyDown += Form1_KeyDown;
        }
               
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            Computer comp = new Computer();
            Keyboard keyboard = comp.Keyboard;
            if (keyboard.CapsLock)
            {
                MessageBox.Show("CAPS LOCK AÇIK");
            }
            else
               
                {
                    MessageBox.Show("CAPS LOCK KAPALI");
                }
        }
       
    }
}
//Bir sonraki makalede görüşmek üzere. Bahadır ŞAHİN