FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Symbol position
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Symbol position
Posted: Sat Jun 24, 2023 07:47 PM
There is a TSAY control :
Code (fw): Select all Collapse
@ 20,20 SAY oCl  PROMPT "Some text"  PIXEL  OF oDLG  SIZE 100, 20  FONT oFont
The text is pressed to the left. In this case, I can easily determine the starting position of any character.
For example, the 6th -"t"
Code (fw): Select all Collapse
GetTextWidth(NIL, left(oCl:GetText(),5), oFont:hFont)+1
However, if the text in TSAY is centered,
Code (fw): Select all Collapse
@ 20,20 SAY oCl  PROMPT "Some text"  PIXEL  OF oDLG  SIZE 100, 20  FONT oFont  CENTER
then the position of the symbol cannot be calculated in this way.
How can this be done ?

Continue the discussion