简体   繁体   中英

How to know offsets within EDIT control to draw text?

I'm subclassing the EDIT common control to add some special placeholder text behavior in the background and I'm curious how to know offsets to draw text within in?

h and w in this diagram:

在此处输入图片说明

Use EM_GETRECT to get the formatting rectangle for edit control. For example:

SendMessage(hedit, EM_GETRECT, 0, (LPARAM)&rect)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM