Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Richtextbox offset not working

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
AU
The Richtextbox vertical offset only seems to work in the downwards direction in 2000 and Windows XP although it works in both directions in Windows 98.

I wrote a app before 2000 that definitely behaves this way and new apps also do this.

Is there possible a newer version of Richtextbox that works in VB6 ?

I need it to readjust the bottom of text when changing from "Arial" to "Arial Narrow" on the same line as it's bottom is different for the same height letter. (Otherwise I have to make a permanent positive correction for "Arial")
 
I'm not sure I understand what RTB property you are talking about. Cn you be more explicit?
 
Richtextbox1.SelChrOffset = 20 should move the baseline of the next character up 20 pixels. -20 will move it down.

Positive values don't have any effect in Win2000 or XP although they work OK in Win98.

It is essential when mixing characters of different heights or fonts in different boxes aligned side by side as the height of a whole line is taken from the top of the character.
 
Ok

>pixels

Twips, in fact.

I should also point out that it doesn't actually move the baseline.

And I'm afraid that it works fine both up and down on my XP box and on my Vista box and (fx: open Dameware ...) on my ancient Windows 2000 Professional. All running the VB6 SP6 version of the RTB. So I can't offer any guidance.
 
Thanks
My richtextbox definitely won't raise the text in 2000 or XP. but will in Win98

Mine is RICHTX32.OCX 208kb 6/7/2007.

It might have come from unpacking the VB service pack as it's date is different to the windows files.

Is that the same as yours?
 
Yes it moves the whole character vertically and because the text height it gives the impression it also moves the baseline like different font sizes do.
It is the baseline of different height characters that I want to align with other boxes arranged in a row.

If I change the offset within the one box, the bottoms remain aligned and the top becomes the "latitude" of the highest letter. I however want them to be in different boxes like cells in a giant multicolored spreadsheet.

Also is there any way to set the cursor position horizontally to a fixed tab position irrespective of the size and font name selected (which is a proportional font anyway)?
That way I could use one common line and print the data in various colors and sizes after each "tab".
 
Disregard my question on TAB, It does seem to move a fixed amount irrespective of the font chosen when new text is being entered. I was confused by it's operation when a word is longer than the distance between tabs and when in insert mode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top