using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Fron { public partial class SelectKeypress : Form { #region Declarations private List _keypresses; public struct Keypress { public string Description; public byte KeyCode; public byte KeyExtend; public Keypress(string description, byte keyCode) { Description = description; KeyCode = keyCode; KeyExtend = 0x00; } public Keypress(string description, byte keyCode, byte keyExtend) { Description = description; KeyCode = keyCode; KeyExtend = keyExtend; } public override string ToString() { return Description; } }; #endregion #region Constructors / Teardown public SelectKeypress() { InitializeComponent(); } #endregion #region Public Properties public Keypress SelectedKeypress { get { return (Keypress)cboKeypress.SelectedItem; } } #endregion #region Event Handlers private void SelectKeypress_Load(object sender, EventArgs e) { _keypresses = new List(); _keypresses.Add(new Keypress("Enter", 0x05)); //TODO: Add more here... cboKeypress.DataSource = _keypresses; cboKeypress.SelectedItem = _keypresses[0]; } private void btnSend_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; this.Close(); } private void btnCancel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; this.Close(); } #endregion } }