Ejemplo n.º 1
0
 public void _PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     if (ForeColor == Color.Red)
     {
         try {
             string txt = (KeyEventUtility.GetCharFromKey(KeyInterop.KeyFromVirtualKey(e.KeyValue)) + "").ToUpper();
             if (String.IsNullOrEmpty(txt) || String.IsNullOrWhiteSpace(txt))
             {
                 txt = "null";
             }
             _keys[MyPosition()] = txt;
             this.Text           = _keys[MyPosition()];
         } catch { }
         save();
         ForeColor = Color.Black;
         LoseFocus();
     }
 }
Ejemplo n.º 2
0
        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            char c = (KeyEventUtility.GetCharFromKey(KeyInterop.KeyFromVirtualKey(e.KeyValue)) + "").ToUpper()[0];

            keys[(int)c] = false;
        }