O
Olaf Rabbachin
Hi everybody,
in a VB.Net (VS 2005) application, there is basically three "states" in
which controls are to signal what can be done with them. Usually, values
loaded into controls may be looked at, but not edited ("Locked"). In
certain cases (simplest: user has the permission to change data), controls
allow changing their contents. While certain operations are being carried
out, controls are completely disabled (i.e. the form itself has its
Enabled-property set to <False>).
Thus I need a way of at least visually distinguishing between <.Enabled =
False> and i.e. <"Locked" = True>. The easiest way would be to have
controls appear exactly as the <.ReadOnly> property does - the controls'
background appears grayed out, but the forecolor remains black. This also
enhances readability and copying text or seeing the tooltip is also
possible.
Too bad this property can only be found in some controls but not even for
some the most usual ones, i.e. TextBox and DataGridView have it, but
ComboBoxes and DatePickers don't.
The <EnabledChanged> event didn't help either, as setting the forecolor of
the resepective control seems to not be considered when the control is
disabled.
Any idea how I could realize something like a <ReadOnly> appearance for
controls that themselves do not publish that property?
Cheers & TIA,
Olaf
in a VB.Net (VS 2005) application, there is basically three "states" in
which controls are to signal what can be done with them. Usually, values
loaded into controls may be looked at, but not edited ("Locked"). In
certain cases (simplest: user has the permission to change data), controls
allow changing their contents. While certain operations are being carried
out, controls are completely disabled (i.e. the form itself has its
Enabled-property set to <False>).
Thus I need a way of at least visually distinguishing between <.Enabled =
False> and i.e. <"Locked" = True>. The easiest way would be to have
controls appear exactly as the <.ReadOnly> property does - the controls'
background appears grayed out, but the forecolor remains black. This also
enhances readability and copying text or seeing the tooltip is also
possible.
Too bad this property can only be found in some controls but not even for
some the most usual ones, i.e. TextBox and DataGridView have it, but
ComboBoxes and DatePickers don't.
The <EnabledChanged> event didn't help either, as setting the forecolor of
the resepective control seems to not be considered when the control is
disabled.
Any idea how I could realize something like a <ReadOnly> appearance for
controls that themselves do not publish that property?
Cheers & TIA,
Olaf