Drawing a line in a RichTextBox

bjwade62
01-17-2005, 07:07 AM
I'd like to have a vertical line in a richtextbox which will indicate that a certain # of characters have been reached. I've tried the line tool but that wont move to the front, therefore it can't be seen at run-time.

Any suggestions?

Thanks,
Bernie

zelg37
01-17-2005, 09:26 PM
The line control is a lightweight control so it has no DC (device context) and therefore can't appear in front of a rich text control.

Instead use a picturebox control instead with the following property settings:

Appearance: 0 - Flat
Border Style: 0 - None
BackColor: &H00000000&
Width: 1 pixel (usually about 15 if .ScaleMode is set to twips)

You should also set the picturebox control to be in front of the richtextbox control using:
Format menu > Order > Bring to Front

or, at runtime:

Picture1.Zorder 0

Gruff
01-17-2005, 11:03 PM
You realize that with proportional fonts (Just about all of them.) Each line could have (and most likely will have.) A different number of characters when you reach the vertical line? (i.e., "i" is thinner than a "W")

~T

bjwade62
01-18-2005, 06:09 AM
Good point. I hadn't thought of that. Guess I'll scrap that idea. Thanks for saving me a bunch of time.

You realize that with proportional fonts (Just about all of them.) Each line could have (and most likely will have.) A different number of characters when you reach the vertical line? (i.e., "i" is thinner than a "W")

~T

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum