المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : EM_SETTABSTOPS and tab width in pixels?



C++ Programming
09-08-2009, 03:13 PM
Hi,

I would like to change the appearance of tabs in a multiline edit control, all tabs should have the same width of 8 pixels. MSDN (http://msdn.microsoft.com/en-us/library/8ebb2696.aspx)[^ (http://msdn.microsoft.com/en-us/library/8ebb2696.aspx)] talks about dialog units, where I would like to specify pixels. The following line sets the distance to "something" depending on the font size of the edit control:

int nTabWidth = 8; m_edit.SetTabStops(nTabWidth); //or optionally....
::SendMessage(m_edit.m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&nTabWidth);

How to calculate the correct value? Thanks for any help.


Webchat in Europe (http://www.pichat.net/) http://www.barakasoft.com/script/Forums/Images/coffee.gif (only 4K (http://www.godx.de/en/C4_tiny_chat_software))