Friday, July 03, 2015
    Search Web Link
Search Software
API Home » Text » TextOut


Category: Text
Hits: 9951 Rating: TextOut has been rated 2.62 by  1522 users (2.62) votes 1522
Rate: 1-star  2-stars  3-stars  4-stars  5-stars
E-mail this API to friend E-mail this Code to a friend  save Bookmark this VB API Function
API Explanation
TextOut displays a line of text on a device. The relation of the text to the (x,y) pair passed to the function can be set using SetTextAlign. The text will be displayed using the device's currently selected font and text drawing color. The function returns 1 if successful, or 0 if an error occured.

Parameter Information
Declare Function TextOut Lib "gdi32.dll" Alias "TextOutA" _
(ByVal hdc As Long, ByVal x As Long, ByVal y As Long, _
ByVal lpString As String, ByVal nCount As Long) As Long

The device context of the device to display the line of text on.
The x coordinate of the reference point to display the text at.
The y coordinate of the reference point to display the text at.
The string to display on the device.
The size in characters of lpString.

' Display the text "Hello, world!" on window Form1 at (100,50).
' Center the text horizontally at that point and have it appear below the point.
Dim retval As Long ' return value

' Set the reference point to be centered horizontally and on the top edge of the text:
retval = SetTextAlign(Form1.hDC, TA_CENTER Or TA_TOP Or TA_NOUPDATECP)
' Display the text:
retval = TextOut(Form1.hDC, 100, 50, "Hello, world!", 13)

Copyright © 2000 - 2013 Ex-designz. All rights reserved. Website Developed By Dexter Zafra of
Link to us | Advertisement | Contact us | Privacy Policy | Terms of use | Accessibility