The UNICODE is supported starting from Windows 2000
order to display some Unicode
characters you need Unicode fonts like "Arial Unicode MS" in your
fonts must be assigned to your controls if needed (use the Font
property) or the ctlUniStyler
library is compatible with all Windows versions supporting
>> Configure "Regional Settings" <<
You may experience problems when using this
library in VB6 Environment if you press the VB6 stop button; don't
worry because when your program will
be compiled all will work ok; these controls has been tested for a lot
of time and in many commercial applications.
Use the sample project in UNICODE platforms (Windows 2000+) or you
cannot see many pieces of texts because I've used a .ini UNICODE file
(not compatible with old Windows platforms).
You need a working
copy of the Microsoft Visual Basic 6 Environment with the latest
Service Pack available (actually version 6b). Every version of VB6 is compatible.
windowless control doesn't have a Window handle so it is ligher than a
windowed control; it doesn't provide also a hWnd property.
These usercontrols are drawn on the parent window and are always below
windowed controls; so for example a ctlUniImageWL
control (windowless) cannot be over a ctlUniTextBoxXP
Managing .ini files
use the clsFileIni and clsFileIniEx classes.
Non UNICODE systems like Windows 95/98/Me/NT4 where using the
clsFileIni class with UNICODE files you'll obtain empty strings because
UNICODE APIs fail (The ANSI API used on Unicode files fails). Old
Windows systems only support ANSI .ini files; you can use Unicode .ini
files in old system using the clsFileIniEx class.
32bpp alpha images
At design-time use the "Custom..." property
panel from the VB6 properties list of the selected control
At run-time set the Picture property of the control using a StdPicture
object obtained using the clsCommonWrapper.LoadPicture
Unicode Caption, Text, Tooltip at
You can set-up Unicode properties at design-time (Text, Caption, Tip)
only using the Custom Property Panel,
because the VB6 property panel is Ansi.
In order to make the tooltip
work correctly check the next topic
In order to use Unicode
1- Draw a ctlUniToolTipManager
control on the first form of your
application (this enables tooltips and manages the tooltip form
2- Set the "Tip" property of controls, don't
use the ToolTipText
because is ANSI only.
Multi Language Helper Class that permits you to translate your forms
with only one row of code; see
KeyPress, KeyUp events
VB6 uses Signed integers for KeyDown, KeyPress and KeyUp events;
Unicode also uses two bytes (like a VB6 integer) but Unsigned, so the
VB6 definition is OK for the event but the KeyAscii / KeyCode value may
arrive negative as this Unicode library passes the two bytes value
directly to the VB6 standard event.
You can manage the KeyAscii / KeyCode value simply by using the
It's also possible to obtain the real Unsigned Integer (in a VB6 long)
from the negative value simply by converting the KeyAscii / KeyCode
value to a Long using the clsCommonWrapper.MakeDWord
KeyPreview MUST not be used as the VB6 form
container is not
Unicode and may filter chars in some systems. I tried it using Italian
and English locales and it works as these locales supports the full
By setting the locale to chinese the KeyPreview property causes
controls to run incorrectly.
If you need the KeyPreview property, do it by hands managing KeyDown,
KeyPress and KeyUp events of controls.
VB6 controls return mouse coordinates in Twips,
Library uses and expects coordinates in Pixels
This can be a problem only in the DragOver
returns coordinates in Twips as VB6 manages them directly); just
convert the coordinates in Pixels before passing them to our methods
Private Sub ctlUniListView1_DragDrop(Source
As Control, X As Single, Y As Single)
If Source Is ctlUniListView1 Then
Dim liIns As
Set liIns =
Dim li As clsUniLV_ListItem
Set li =
vbTwips, vbPixels), scaleY(Y,
If Not li Is Nothing Then
ctlUniListView1.ListItems.Add li.Index, liIns.Key, liIns.Text,
ctlUniListView1.ListItems.Add , liIns.Key, liIns.Text, liIns.Icon,
If you need to drag Unicode files to a control, implement the
OLEDrag&Drop events and use the GetUnicodeDroppedFiles
to get the list of dragged files (in Unicode) from the OleDragDrop
If you need to drag Unicode text from a control or another app to yours
act as follows:
1- define a const like this:
Const vbCFUnicode = 13&
2- if you start the OleDrag from a control of your application save
data in Unicode format (OLEStartDrag event):
Dim b() As Byte
b = Text1.SelText
data.SetData b, vbCFUnicode
3- read the text in Unicode format (if available, OLEDragDrop event):
If data.GetFormat(vbCFUnicode) Then
Text2.SelText = data.GetData(vbCFUnicode)
ElseIf data.GetFormat(vbCFText) Then
Text2.SelText = data.GetData(vbCFText)
See documentation here
These controls have the Font property. If you set the font in this way:
Set Usercontrol.Font = MyFont
the control will change the font immediately
If you use a construct like this:
Usercontrol.Font.Name = "Verdana"
the control will
the changes made to the font object.
In VB6 usercontrols there is a method that will permit UserControls to
know if a property of the font has changed but this method is quite
expensive (in terms of memory used) so we preferred not to add it.
We added a new method to all controls called "ApplyFontChanges" that
you can call when you need to notify the control the change of the Font.
so you have to write:
Usercontrol.Font.Name = "Verdana"
custom VB6 usercontrols
Some controls contained into this package may have bad iterations when
used into Usercontrols.
This because VB6 cannot detect, in some cases, that the usercontrol is
in Design or User mode so the control may appear running at design time
(so you cannot move it in many cases).
can create your usercontrols using a simple
tip described here
RTL VB6 Forms
Execute the SetWindowLayout
function in the form load event of your forms; note that child controls
need to have the RTL property set manually (they don't inherit this
You can change the predefined
by setting the property DefaultButtonStyle
of the clsCommonWrapper
class before your program starts
(or in the initialize event of your first form).
This value is global for every control in your application.
You can change the style and colors of your controls using the ctlUniStyler control.
Load and use 32bpp alpha
It is possible to load and assign 32bpp alpha images to controls at
design time only by using this specific custom
At runtime simply use the clsCommonWrapper.LoadPicture
function instead of the VB6 LoadPicture.
If you need to render a 32bpp image use the clsCommonWrapper.RenderPicture
Right To Left Support
Every control in version 4 supports RTL reading; just select RightToLeft on the control
properties or set it to the various AddPanel, AddItem, AddTab methods in complex
controls (StatusBar, ListView, ToolBar, Tabulator)
RightToLeft flag influences the appearance of the Unicode Tip so
it has been created also for controls like the ctlUniImageWL that have
no text (but can contain a RTL Tooltip).
Visual Basic 6
msvbvm60.dll, OLEAUT32.DLL, OLEPRO32.DLL
that permit VB6 programs to run.
Refer to file "Sample Install.iss" (The Inno Setup Script used to make
the setup for this library) if you need to create a new setup for your
The Latest VB6 runtime can be downloaded from our site at this address:
libraries MUST be distributed with your compiled application.
starting from Windows
2000 these components are already distributed by Microsoft.
Layer for Unicode)
wraps every Unicode
function (exported by GDI32.dll and USER32.dll) and chooses if call the
Ansi or Unicode one basing on the current Windows version.
library MUST be distributed with your compiled application.
You can put this file into the Windows\System32 directory or in your
installation path; you don't need to register this component.
|Only if you are using the
ctlUniRichTextBoxXP control in your application with an old Windows
This is the Microsoft RichEdit control update for version 3.0 (the
latest available). I suggest you to install this upgrade on your
customers if they are using your application under Windows 95 - 98 - Me
Without the update the ctlUniRichTextBoxXP will continue work but with
can check the RichEdit library version using the ctlUniRichTextBoxXP.RichEditVersion
Download the package from here
all interface declarations and definitions for our library
only at design time, just copy it in the same folder of your project