コード例 #1
0
        private bool OnPaste()
        {
            if (Clipboard.ContainsText())
            {
                string text = Clipboard.GetText();
                if (IsInteger(text))
                {
                    return(false); // handle locally
                }
                else
                {
                    if (null != PasteEvent)
                    {
                        PasteEventArgs args = new PasteEventArgs();
                        args.FieldIndex = FieldIndex;
                        args.Text       = text;
                        PasteEvent(this, args);
                        return(true); // let parent handle it
                    }
                }
            }

            return(false);
        }
コード例 #2
0
 private void OnPaste(object sender, PasteEventArgs e)
 {
     Text = e.Text;
 }