Home All Groups Group Topic Archive Search About

RichTextBox problem with BorderStyle

Author
1 Feb 2006 11:26 PM
Chris
I've added a RichTextBox control to my form (VB6 app) and set the following
properties...

BorderStyle = rtfNoBorder
Appearance = rtfFlat
ScrollBars = rtfVertical

When I run the application and enter lots of text until the scrollbar comes
on I have a display issue with the scrollbar.  The main part of the
scrollbar is the standard Windows XP blue.  However, the two arrows at the
top and bottom of the scrollbar are in the old style grey icons.  If I move
the form off the screen and back again, it refreshes the grid fine.

It only seems to happen when I set the properties mentioned above, but I
require them to be set like this because the control is hosted in another
control, so I don't want any 3D effects.

Any suggestions on how I can fix this graphical glitch?


Thanks,
Chris

Author
2 Feb 2006 5:18 AM
Mike Williams
"Chris" <cw@community.nospam> wrote in message
news:ubPi3b4JGHA.1288@TK2MSFTNGP09.phx.gbl...

> I've added a RichTextBox control to my form (VB6 app)
> and set the following properties...
> BorderStyle = rtfNoBorder
> Appearance = rtfFlat
> ScrollBars = rtfVertical
> <snip> the two arrows at the top and bottom of the scrollbar
> are in the old style grey icons.  If I move the form off the screen
> and back again, it refreshes fine.

I hardly ever use RTBs and I've never noticed that behaviour before, but
sure enough that's what happens on my XP system too. Must be a bit of an
"undocumented feature" that they never got around to fixing. I've just been
playing with it (they can't touch you for it these days!) and it seems that
the arrows drawn wrongly, or perhaps the wrong graphic is selected, the
first time they are required but they are drawn properly every other time
thereafter. Curiouser and curiouser! Anyway, after a bit more playing around
I tried the following, which seems to effectively work around the problem:

Private Sub Form_Load()
RichTextBox1.Text = Replace(Space(100), " ", vbCrLf)
RichTextBox1.Text = ""
End Sub

Mike
Author
2 Feb 2006 9:41 AM
Chris
Nice suggestion.  Thanks Mike.


Chris



Show quoteHide quote
"Mike Williams" <M***@WhiskyAndCoke.com> wrote in message
news:%23rDYTg7JGHA.2320@TK2MSFTNGP11.phx.gbl...
> "Chris" <cw@community.nospam> wrote in message
> news:ubPi3b4JGHA.1288@TK2MSFTNGP09.phx.gbl...
>
>> I've added a RichTextBox control to my form (VB6 app)
>> and set the following properties...
>> BorderStyle = rtfNoBorder
>> Appearance = rtfFlat
>> ScrollBars = rtfVertical
>> <snip> the two arrows at the top and bottom of the scrollbar
>> are in the old style grey icons.  If I move the form off the screen
>> and back again, it refreshes fine.
>
> I hardly ever use RTBs and I've never noticed that behaviour before, but
> sure enough that's what happens on my XP system too. Must be a bit of an
> "undocumented feature" that they never got around to fixing. I've just
> been playing with it (they can't touch you for it these days!) and it
> seems that the arrows drawn wrongly, or perhaps the wrong graphic is
> selected, the first time they are required but they are drawn properly
> every other time thereafter. Curiouser and curiouser! Anyway, after a bit
> more playing around I tried the following, which seems to effectively work
> around the problem:
>
> Private Sub Form_Load()
> RichTextBox1.Text = Replace(Space(100), " ", vbCrLf)
> RichTextBox1.Text = ""
> End Sub
>
> Mike
>
>