How to know the size in pixels of tab stops in edit control (RichEdit)?

How to know the size in pixels of tab stops in edit control (RichEdit)?

Post by borewil » Sat, 17 Sep 2005 09:53:36


Does someone know how to correct detect size of tab stop in edit
control?
I currently use
rc.right=32;
MapDialogRect(hDialogThatHostEditControl,&rc);
TabSize=rc.right;

I try also
GetTextExtentPoint32(hEditDC,"\t",1,&sz);
TabSize=sz.cx;

And
GetTextMetrics(hdc,&tm);
TabSize=(32*tm.tmAveCharWidth)/4;

But in larger screen DPI it give wrong results(different WinXP,Win2K) I
can take true size by select tabstop and make screen shot!
How to correctly detect tabsize in all possible screen DPI settings in
all Windows OS?
 
 
 

How to know the size in pixels of tab stops in edit control (RichEdit)?

Post by Kellie Fit » Sat, 17 Sep 2005 10:58:33

Hi,

Well, according to microSoft, the default size of tab stop is set
at every 32 dialogBox template units, however, you can set & adjust
the tab size according to your application's needs, simply by using
the API SendMessage(), to send the EM_SETTABSTOPS Message
to your multiLine edit control.

http://www.yqcomputer.com/

http://www.yqcomputer.com/

Hope these information helps,

Kellie.

 
 
 

How to know the size in pixels of tab stops in edit control (RichEdit)?

Post by Kellie Fit » Sat, 17 Sep 2005 11:03:16

Hi,

Well, according to microSoft, the default size of tab stop is set
at every 32 dialogBox template units, however, you can set & adjust
the tab size according to your application's needs, simply by using
the API SendMessage(), to send the EM_SETTABSTOPS Message
to your multiLine edit control.

http://www.yqcomputer.com/

http://www.yqcomputer.com/

Hope these information helps,

Kellie.
 
 
 

How to know the size in pixels of tab stops in edit control (RichEdit)?

Post by TC » Sat, 17 Sep 2005 16:55:14

Please don\t MULTIPOST the same question to different groups with
different subject lines !!

This is a guaranteed way to make people angry. Look up multiposting &
crossposting, to understand how to do it.

HTH,
TC
 
 
 

How to know the size in pixels of tab stops in edit control (RichEdit)?

Post by borewil » Wed, 21 Sep 2005 05:28:51

Thank you all for your replies.
I test again and found that my program working wrong with only 150%
screen DPI under Windows 2000. However after I saw some wrong dialogs
from Microsoft under unstandard screen DPI settings I think maybe
problem is not in my program. It is interesting how many people used
non standard screen DPI.

Thank you.
 
 
 

How to know the size in pixels of tab stops in edit control (RichEdit)?

Post by borewil » Wed, 21 Sep 2005 05:32:09

I'm sorry.
 
 
 

How to know the size in pixels of tab stops in edit control (RichEdit)?

Post by TC » Wed, 21 Sep 2005 09:55:13

No probs :-)

TC