Jump to content
Sign in to follow this  
Jacek Laskowski

Differences in displaying the tab character

Recommended Posts

I have TMemo and TVirtualTreeView on my form. Both controls set the same font, Ubuntu Mono.
The text in both controls is the same, contains one tab (#9, marked in memo).
Why does TMemo display it differently (wide) and VTV differently (narrow)?

 

image.thumb.png.60ea467e3530f85c5e5960668b4d2715.png

Share this post


Link to post

you have to edit VTV sources and before every DrawText(W) do a

DrawFormat := DrawFormat or DT_EXPANDTABS or DT_TABSTOPS;

DrawFormat := DrawFormat or (FTabwidth shl 8);

and you can create a property of FTabwidth, (plus one for Expandtabs yes/no).

 

Edited by Attila Kovacs
  • Thanks 1

Share this post


Link to post
On 5/20/2020 at 9:19 PM, Attila Kovacs said:

you have to edit VTV sources and before every DrawText(W) do a

DrawFormat := DrawFormat or DT_EXPANDTABS or DT_TABSTOPS;

DrawFormat := DrawFormat or (FTabwidth shl 8);

and you can create a property of FTabwidth, (plus one for Expandtabs yes/no).

 

Thanks, this works!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×