does someone can show me a working Sample

Code: Select all
nPixelX := GetWindowTextWidth(Form_1.HANDLE, "hello world")

Moderator: Rathinagiri
Code: Select all
nPixelX := GetWindowTextWidth(Form_1.HANDLE, "hello world")
Code: Select all
FUNCTION DoGetFontHeight(cText)
LOCAL hWnd := Form_1.HANDLE
LOCAL hDC := GetDC(Form_1.HANDLE)
LOCAL hFont := HMG_CreateFont ( hDC , SP_cFontName(), SP_nFontSize(), .F., .F., .F., .F. )
LOCAL nPixelY
nPixelY := GetTextHeight( hDC, cText, hFont )
ReleaseDC( hWnd, hDC )
DeleteObject (hFont)
RETURN nPixelY
Code: Select all
nPixelX := GetTextWidth( hDC, cText, hFont )