getTextExtent question
- Posted by George Walters <gwalters at sc.rr.com> Dec 15, 2004
- 509 views
I've been using this code snippet to get the extent of characters, but I must be doing something wrong. The MleText control below shows an X extent of cx*30 which I want it to be enough space to allow 30 characters on each line. I can get only 17 characters. Does anyone see anything wrong.
setFont(Screen, "Courier New", fs, Normal) charSize = getTextExtent(Screen,"abcdefghij") cx = charSize[1]/10 cy = charSize[2]+3 commentsId = create(MleText, "", invoiceParameters, cx*3, cy*3, cx*30, cy*4,0) setFont(commentsId,"Courier New", fs, Normal) tmp = sendMessage(commentsId,EM_LIMITTEXT,108,NULL)