Declare Function GetTextAlign Lib "gdi32.dll" (ByVal hdc As Long) As Long
Platforms: Win 32s, Win 95/98, Win NT
GetTextAlign determines how a device displays a line of text relative to a given reference point. The reference point is the point used to specify where the device should display a line of text. The function returns exactly three of the following flags specifying where this reference point will be relative to the text (one flag specifies horizontal position, one specifies vertical position, one determines current point updating):
Example:
' Display whether window Form1 will display text left-justified,
' centered, or right-justified relative to a given reference point.
Dim refpoint As Long ' receives reference point settings
refpoint = GetTextAlign(Form1.hDC) ' get the text alignment setting of the window
If (refpoint And TA_RIGHT) = TA_RIGHT Then ' ref. point on right edge
Debug.Print "Text will be displayed right-justified."
ElseIf (refpoint And TA_CENTER) = TA_CENTER Then ' ref. point horizontally centered
Debug.Print "Text will be displayed centered horizontally."
Else ' assume ref. point on left edge
Debug.Print "Text will be displayed left-justified."
End If
See Also: SetTextAlign, TextOut
Category: Fonts & Text
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/g/gettextalign.html