David Youngblood
3/15/2011 11:33:00 PM
"NadCixelsyd" <nadcixelsyd@aol.com> wrote in message
news:f1991b9a-721a-4d53-a908-a1b1564b4fad@x8g2000prh.googlegroups.com...
> The DOS prompt uses the font "Terminal", AKA Code Page 437, which has
> character representation for just about all 256 characters. For CHR
> $(13), they list a small musical note.
>
> I have my font set to "Terminal". I want to print that note, but when
> I print CHR$(13), it goes to the next line. Is there a way to get VB6
> to interpret CHR$(13) as character and not as a command to start a
> newline. (And also: CHR$(9) and CHR$(10) to not tab and line-feed
> respectively)
Print to where? AFAIK, the "Terminal" font that comes with windows is a
Screen only font, not a Printer font. If you want to print to a form or
picture box (or if you have a Printer "Terminal" font), you can print the
non-printable characters using the TextOut API. However, some of the
behavior has changed with Win7. You might look up my earlier post, regarding
non-printable characters in single line edit boxes.
David
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" ( _
ByVal hdc As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal lpString As String, _
ByVal nCount As Long) As Long
Private Sub Form_Load()
Dim i As Long, s As String
For i = 1 To 31
s = s & Chr(i)
Next i
With Me
.AutoRedraw = True
.FontName = "Terminal"
.FontSize = 12
TextOut .hdc, 0, 0, s, Len(s)
End With
' For comparison
Print
Print
Print
Print s
End Sub