Download KeyboardSupportDemo.zip version 1.0.0.0, last updated 04/06/2016 (10.17 KB)

Download
  • md5: 90e557815ee49f581745ed334ea2d9ed
  • sha1: 3fbc13752142394a4c4dcab84de6ffce94de3b4f
  • sha256: eb014fe61a006edcbe89107bc437dd99b3910badf471f20dc30d79fd7edbc743
using System;
using System.Windows.Forms;

// Adding keyboard accelerators and visual cues to a WinForms control
// http://www.cyotek.com/blog/adding-keyboard-accelerators-and-visual-cues-to-a-winforms-control
// Copyright 2016 Cyotek Ltd. All Rights Reserved.
//
//  If find this code useful, attribution, donations or contributions are welcome.

namespace Cyotek.Articles.KeyboardSupport
{
  public partial class DemoForm : Form
  {
    #region Constructors

    public DemoForm()
    {
      this.InitializeComponent();
    }

    #endregion

    #region Methods

    private void button_Click(object sender, EventArgs e)
    {
      eventsListBox.AddEvent(button, "Click", e);
    }

    private void button_Enter(object sender, EventArgs e)
    {
      eventsListBox.AddEvent(button, "Enter", e);
    }

    private void button_KeyDown(object sender, KeyEventArgs e)
    {
      eventsListBox.AddEvent(button, "KeyDown", e);
    }

    private void button_KeyPress(object sender, KeyPressEventArgs e)
    {
      eventsListBox.AddEvent(button, "KeyPress", e);
    }

    private void button_KeyUp(object sender, KeyEventArgs e)
    {
      eventsListBox.AddEvent(button, "KeyUp", e);
    }

    private void button_Leave(object sender, EventArgs e)
    {
      eventsListBox.AddEvent(button, "Leave", e);
    }

    private void button_MouseDown(object sender, MouseEventArgs e)
    {
      eventsListBox.AddEvent(button, "MouseDown", e);
    }

    private void button_MouseUp(object sender, MouseEventArgs e)
    {
      eventsListBox.AddEvent(button, "MouseUp", e);
    }

    #endregion
  }
}

Donate

Donate