vb 特殊字符 乱码
问题如下:有几个特殊字体需要打印,发现vb中显示乱码 希腊特殊字符 ...(csdn也不让输入特殊字符啊
-_-!)大神们可以再vb的编辑器里输入的试下,我这里显示都是?,怎么才能正常显示啊?求大神帮忙 vb?乱码
[解决办法]
可以用啊!
Option Explicit
Private Sub Form_Load()
Text1.Text = "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" & vbCrLf & _
"αβγδεζηθικλμνξοπρστυφχψω"
End Sub
Option Explicit
Private Declare Function TextOut Lib "gdi32" Alias "TextOutW" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As Long, ByVal nCount As Long) As Long
Private Sub Form_Load()
Dim str As String
Me.FontName = "Times New Roman"
Me.FontSize = 16
Me.AutoRedraw = True
str = ChrW(&H2660) & ChrW(&H2663) & ChrW(&H2665) & ChrW(&H2666)
TextOut Me.hdc, 0, 0, StrPtr(str), Len(str)
End Sub
RichTextBox1.SelFontName = "webdings"
For i = A To B
str = ChrW(i)
SendMessage RichTextBox1.hWnd, EM_REPLACESEL, 0, ByVal str
Next
Private Sub Command1_Click()
Dim str As String
RichTextBox1.SelFontName = "webdings"
For i = &H21 To &HFF
str = ChrW(i)
SendMessageW RichTextBox1.hWnd, EM_REPLACESEL, 0, ByVal str
Next
End Sub
Option Explicit
Private Declare Function TextOut Lib "gdi32" Alias "TextOutW" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As Long, ByVal nCount As Long) As Long
Private Sub Form_Load()
Dim str As String
Me.Font.Name = "Webdings"
Me.Font.Charset = 2
Me.Font.Size = 16
Me.AutoRedraw = True
str = ChrW(&HA5) & ChrW(&HA6)
TextOut Me.hdc, 0, 0, StrPtr(str), Len(str)
Me.FontName = "Wingdings"
TextOut Me.hdc, 0, 20, StrPtr(str), Len(str)
End Sub
Option Explicit
Private Declare Function TextOut Lib "gdi32" Alias "TextOutW" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As Long, ByVal nCount As Long) As Long
Private Sub Form_Load()
Dim str As String
Dim i As Long
Me.Font.Name = "Webdings"
Me.Font.Charset = 2
Me.Font.Size = 16
Me.AutoRedraw = True
For i = &H80 To &HFF
str = str & ChrW(i)
Next
TextOut Me.hdc, 0, 0, StrPtr(str), Len(str)
End Sub
Private Sub Form_Load()
Dim str As String
Dim i As Long
For i = &H80 To &HFF
str = str & ChrW(i)
Next
TextBox1.Font.Name = "Webdings"
TextBox1.Font.Charset = 2
TextBox1.Font.Size = 16
TextBox1.Text = str
End Sub
Private Sub Command1_Click()
With TextBox1
.SelStart = 5
.SelLength = 0
.SelText = ChrW(vbKeyA + Int(Rnd() * 26))
End With
End Sub