Exemplo n.º 1
0
 protected override void OnKeyDown(KeyEventArgs args)
 {
     if (CanTextCommit != null && (args.Key == Keys.RETURN || args.Key == Keys.NUMPADENTER))
     {
         var canArgs = new CanCommitEventArgs { Cancel = false };
         CanTextCommit(this, canArgs);
         if (canArgs.Cancel) return;
     }
     base.OnKeyDown(args);
 }
Exemplo n.º 2
0
 void Binding_CanTextCommit(object sender, CanCommitEventArgs e)
 {
     try
     {
         SourcePropertyChanged(sender, null);
     }
     catch (FormatException)
     {
         e.Cancel = true;
     }
 }