Silvio,
I would adjust the text from
Dialog RIGHT-position.That looks much better and the Position is always the same distance from Right.
But if You like, getting closer to the Tabs, just increase the defined Space from right.
Some calculations needed, using
any Font and Text.Without calculation, it will be very hard, to adjust the Text to the needed Position.
![Image](http://www.pflegeplus.com/pictures/Textright.jpg)
@ 0,
any Value SAY oPSay2 PROMPT text OF oApp():oTab COLOR CLR_RED TRANSPARENT
Usage :
Text := "Test String from right"
// any Value of 0, 100. The needed Size 25, 10 will be calculated with the Function.
@ 0, 100 SAY oPSay2 VAR Text SIZE 25,10 OF oApp():oTab CLR_RED PIXEL TRANSPARENT FONT oTxtFont
...
...
// 100 = defined Text-top
// 5 = the wanted Distance between Text-end and Dialog-right
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT TEXT_RIGHT( oPSay2, oTxtFont, 100, oDlg:nRight - 5, cText )
RETURN NILCode: Select all | Expand
FUNCTION TEXT_RIGHT( oSay, oFont, nTop, nLeft, cText )
LOCAL hDC, nTxtWidth, nTxtHeight
hDC := oSay:GetDC()
nTxtHeight := INT( Abs( oFont:nHeight ) ) + 10
IF oFont:lItalic = .F. // Italic
nTxtWidth := INT( GettextWidth( hDC, ALLTRIM(cText), oFont:hFont, ) ) + 6
ELSE
nTxtWidth := INT( GettextWidth( hDC, ALLTRIM(cText), oFont:hFont, ) ) + 10
ENDIF
oSay:ReleaseDC()
oSay:nWidth := nTxtWidth
oSay:Move( nTop, nLeft - nTxtWidth, nTxtWidth, nTxtHeight + ( nTxtHeight / 4 ), .T. ) // adjusted Height
RETURN ( NIL )
Best Regards
Uwe
![Laughing :lol:](./images/smilies/icon_lol.gif)