Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

December 26, 2007

Display Russian Text in VB6

Question:
I need to display Cyrillic text on my VB6 application. I have a file with large collection of Cyrillic strings (corresponding to error messages, captions etc.) and I need to read one of those strings and display it on a form.

Answer:
First, go to this URL which has an online tool for converting your string to a hex-encoded string:
http://www.chilkatasp.net/HexEncodeString.aspx

You may then use the hex string in as a string literal in your VB6 code:

Private Sub Button_Click()
    Dim s As New CkString
    s.AppendEncoded "DF20ECEE", "hex", "windows-1251"
    DisplayCyrillic s, Text1
End Sub

This is the DisplayCyrillic method:

Private Sub DisplayCyrillic(ByRef s As CkString, ByRef txtbox As TextBox)
	
    Dim b() As Byte
    b = s.EmitMultibyte("windows-1251")
	
    Text1.Font.charset = 204
    For i = 0 To UBound(b) - 1
        Text1.Text = Text1.Text + Chr(b(i))
    Next
	
End Sub

The CkString component may be downloaded from:
http://www.chilkatsoft.com/download/ckString.zip

CkString online reference documentation.


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.