Hi Bruce,
Thank you.
Didn't realise disabling killed scrolling.
Pull up! PullUp!
Shall go the intercept way.
Regards
Bob
"Bruce Wood" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Bob wrote:
> > Hi,
> > Is it possible to change the forecolor of a disabled text control.
> > I have a RichText Box that I don't want the user to edit but the Grey on
> > Grey default is hard to read.
> > Is there a way of overriding this with a custom colour?
> > I had a quick foray into the forms Paint event handler but no joy.
> > Thanks
> > Bob
>
> Well, TextBox has a ReadOnly property, which sounds like exactly what
> you want. Unfortunately, RichTextBox doesn't have ReadOnly.
>
> I solved this problem for ComboBox by creating my own
>
> public class ComboBoxWithReadOnly : ComboBox
>
> and then adding the new property, along with the appropriate code to
> intercept keypresses, pastes, and cuts if ReadOnly is true. The
> advantage of this approach, as well, is that the user is still free to
> Copy text from the control (which they couldn't do if it were
> disabled)... they just can't change it.
>
> BTW, this approach is also useful for ListViews and the like, for which
> the disabled control (stupidly) can't be scrolled. So if you want your
> user to be able to scroll and see everything inside the control but
> don't want to allow changes, disabling the control is a non-starter.
>
|