S
Serge Wautier
Env.: WM6 / VS2008 / CF 3.5
Hi All,
I have this winform used to view info (not edit it). It contains a set of
labels and textboxes set in readonly mode.
The problem is that the focus is set automatically to first text box and the
caret is displayed. This is confusing to users because you think you can
type something in there. How can I get rid of this caret?
My dirty workaround is as such: ((Control)MyLabel).Focus();
-> Sets the focus to a label. It's dirty because Label hides Focus() (hence
the typecast). Which means I'm not supposed to use it. (BTW the compiler
emits a warning to remind me so).
Does anyone know of a more elegant/'legal' solution?
Note: Turning the textboxes into labels is not a good option here because
the form is sometimes used in 'view' mode and sometimes in 'edit' mode. And
I want to keep a single layout for both modes.
TIA,
Serge.
Hi All,
I have this winform used to view info (not edit it). It contains a set of
labels and textboxes set in readonly mode.
The problem is that the focus is set automatically to first text box and the
caret is displayed. This is confusing to users because you think you can
type something in there. How can I get rid of this caret?
My dirty workaround is as such: ((Control)MyLabel).Focus();
-> Sets the focus to a label. It's dirty because Label hides Focus() (hence
the typecast). Which means I'm not supposed to use it. (BTW the compiler
emits a warning to remind me so).
Does anyone know of a more elegant/'legal' solution?
Note: Turning the textboxes into labels is not a good option here because
the form is sometimes used in 'view' mode and sometimes in 'edit' mode. And
I want to keep a single layout for both modes.
TIA,
Serge.