Exemplo n.º 1
0
 private void TsmPaste_Click(object sender, EventArgs e)
 {
     if (DatePickerValue.TryParse(Clipboard.GetText(), out DatePickerValue dv))
     {
         this.Value = dv;
     }
 }
Exemplo n.º 2
0
 private void Cms_Opening(object sender, CancelEventArgs e)
 {
     tsmEmpty.Enabled = tsmCopy.Enabled = !this.Value.IsEmpty;
     tsmPaste.Enabled = false;
     if (Clipboard.ContainsText())
     {
         if (DatePickerValue.TryParse(Clipboard.GetText(), out DatePickerValue dv))
         {
             tsmPaste.Enabled = true;
         }
     }
 }
Exemplo n.º 3
0
 private void TxtShowDate_KeyDown(object sender, KeyEventArgs e)
 {
     e.SuppressKeyPress = true;
     if (e.KeyData == (Keys.Control | Keys.V))
     {
         if (Clipboard.ContainsText())
         {
             if (DatePickerValue.TryParse(Clipboard.GetText(), out DatePickerValue dv))
             {
                 this.Value = dv;
             }
         }
     }
     else if (e.KeyData == (Keys.Control | Keys.C) && txtShowDate.SelectionLength > 0)
     {
         Clipboard.SetText(txtShowDate.Text);
     }
     else if (e.KeyCode == Keys.Delete)
     {
         this.Value = new DatePickerValue();
     }
 }