Click here to copy the following block | Option Explicit
Private Sub Command1_Click() Dim i As Integer Dim ta As Long Dim TextLines As Long Dim TextBuff As String Dim CharRet As Long
ta = SetTextAlign(Printer.hdc, TA_CENTER) Printer.CurrentY = (Printer.ScaleHeight / .Parent.ScaleHeight) * .Top TextLines = SendMessage(.hwnd, &HBA, 0, 0) For i = 0 To TextLines - 1 TextBuff = Space(1000) Printer.CurrentX = (Printer.ScaleWidth / .Parent.ScaleWidth) * (.Left + (.Width / 2)) Mid(TextBuff, 1, 1) = Chr(79 And &HFF) Mid(TextBuff, 2, 1) = Chr(79 \ &H100) CharRet = SendMessage(.hwnd, &HC4, i, ByVal TextBuff) Printer.Print Left(TextBuff, CharRet) Next i ta = SetTextAlign(Printer.hdc, ta) End Sub |
|