what should be the new position of the caret after moving one position(left or right)?
tm.tmAveCharWidth(textmetric structure) is no good beacuse chars width depend on their value,so...?
Sorry but I don't use MFC.
I must use api,that's it.
I tried :
newcaretpos=oldcaretpos+tm.AveCharWidth+1
when an ascii char was pressed.
It works for 'a' for ex but for 's' and some other chars the new position is much to far from the old one and I don't now why.
Well, MFC is a wrapper for API so there possibly may be some API function for GetTextExtent(). Try MSDN. Of course it is a direct context member function so I'm not sure, never used API . Hopefully someone else will see this post, its a fairly simple question. You could also try the VC++ forum.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.