PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Re: TextBox ReadOnly ForeColor
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Re: TextBox ReadOnly ForeColor
![]() |
Re: TextBox ReadOnly ForeColor |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Dan,
I have somewhat been able to do what you want by having the text box not be readonly at startup (that way you get the background color you want). Then in the GotFocus event for the text box set the readonly property to True and in the LostFocus set it back to false. This prevents the user from trying to change the data but allows the verticle scrollbar to function and still have color. "Maarten Struys" <maarten.struys@nospam.pts.nl> wrote in message news:OhNtGqMRDHA.2228@tk2msftngp13.phx.gbl... > I see what you need a textbox for. If the foreground color is really > important you could of course consider making your own textbox, derived from > a custom control. > > -- > Regards, > > Maarten Struys > PTS Software bv > ---- > "Dan" <anonymous@devdex.com> wrote in message > news:OzwTl7KRDHA.3796@tk2msftngp13.phx.gbl... > > > > > > Thanks for the quick reply! > > > > I am trying to use the textbox for its scrolling capability. As I am > > sure you are aware, screen real-estate on handheld devices is at a > > premium, so I need to scroll some text. I could implement this with a > > label, but that would involve using a container panel to clip the text > > properly, and implementing a scroll bar to perform the scrolling. > > > > I may just live with the gray color until Microsoft provides a way to do > > this with the textbox. > > > > *** Sent via Developersdex http://www.developersdex.com *** > > Don't just participate in USENET...get rewarded for it! > > |
|
|
|
#2 |
|
Guest
Posts: n/a
|
It is really funny. Since I do programming (not very long, ok ;-) I
always see the discussion about "when I set readonly I also want to set my own colors". I don't understand why MS doesn't accept that many developers need to set their own colors, because of CI, readability or someting else. Maybe one day MS accepts this needs. My solution is, that on the GetFocus event I put the focus on the Form or the TabControl. That way you can set every color you want, you are able to use the scrollbar and the user can't change anything. It's only the wrong solution if you want the user to be able to select text. Regards, Christoph JWW schrieb: > Dan, > I have somewhat been able to do what you want by having the text box not > be readonly at startup (that way you get the background color you want). > Then in the GotFocus event for the text box set the readonly property to > True and in the LostFocus set it back to false. This prevents the user from > trying to change the data but allows the verticle scrollbar to function and > still have color. > > "Maarten Struys" <maarten.struys@nospam.pts.nl> wrote in message > news:OhNtGqMRDHA.2228@tk2msftngp13.phx.gbl... > >>I see what you need a textbox for. If the foreground color is really >>important you could of course consider making your own textbox, derived > > from > >>a custom control. >> >>-- >>Regards, >> >>Maarten Struys >>PTS Software bv >>---- >>"Dan" <anonymous@devdex.com> wrote in message >>news:OzwTl7KRDHA.3796@tk2msftngp13.phx.gbl... >> >>> >>>Thanks for the quick reply! >>> >>>I am trying to use the textbox for its scrolling capability. As I am >>>sure you are aware, screen real-estate on handheld devices is at a >>>premium, so I need to scroll some text. I could implement this with a >>>label, but that would involve using a container panel to clip the text >>>properly, and implementing a scroll bar to perform the scrolling. >>> >>>I may just live with the gray color until Microsoft provides a way to do >>>this with the textbox. >>> >>>*** Sent via Developersdex http://www.developersdex.com *** >>>Don't just participate in USENET...get rewarded for it! >> >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

