M
michael sorens
I have searched through the MSDN documentation but without success for
this very common task: implementing Ctrl-C, Ctrl-V, and Ctrl-X for any of
a number of TextBox controls on a form. Roughly it looks like I want to
set my form's KeyPreview to true, then I can check for the Control key via
something like "if ((Control.ModifierKeys & Keys.Control) =
Keys.Control)..." but then the actual key in e.KeyChar (where e is a
KeyPressEventArgs object) reports the ASCII for the modified character
(i.e. Ctrl-A == 1), so I would have to add an ASCII "A"-1 to be able to
detect "V", etc... All this just seems too low level for the likes of
Visual Studio 2005. Could someone provide enlightenment?
this very common task: implementing Ctrl-C, Ctrl-V, and Ctrl-X for any of
a number of TextBox controls on a form. Roughly it looks like I want to
set my form's KeyPreview to true, then I can check for the Control key via
something like "if ((Control.ModifierKeys & Keys.Control) =
Keys.Control)..." but then the actual key in e.KeyChar (where e is a
KeyPressEventArgs object) reports the ASCII for the modified character
(i.e. Ctrl-A == 1), so I would have to add an ASCII "A"-1 to be able to
detect "V", etc... All this just seems too low level for the likes of
Visual Studio 2005. Could someone provide enlightenment?