Label control

The place for threads about TimoSoft FlatButton.
Post Reply
godeny
Lieutenant
Posts: 18
Joined: 28 Nov 2007, 19:44
Contact:

Label control

Post by godeny »

Hello TiKu,

your unicode-capable control set is a great collection!
Thank you for them!

I was also looking for a unicode label control (my application is translatable by the user), and found the FlatButton control, with it's BorderLayoutModel = blmNeverShowBorder setting. Perhaps you could say alrady in your "What is FlatButton" post, that it is also a replacement for the simplest control.

Zoltan
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Post by TiKu »

Sorry to say this, but FlatButton isn't Unicode-capable.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
godeny
Lieutenant
Posts: 18
Joined: 28 Nov 2007, 19:44
Contact:

Post by godeny »

:-(

Is there a way - another control - which can be turned to a label control ?
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Post by TiKu »

A label more or less is for displaying text only. It shouldn't be that difficult to do the same task with Unicode support. Have a look at the TextOut API function.
Something like this should work (not tested):

Code: Select all

Private Declare Function TextOut Alias "TextOutW" Lib "gdi32.dll" (ByVal hDC As Long, ByVal nXStart As Long, ByVal nYStart As Long, ByVal lpString As Long, ByVal cbString As Long) As Long

Dim s As String

s = "Hello World " & ChrW(&H30A1&)
TextOut Me.hDC, 0, 0, StrPtr(s), Len(s)
If you need a more powerful function, you should use the DrawText API function:

Code: Select all

Private Declare Function DrawText Alias "DrawTextW" Lib "user32.dll" (ByVal hDC As Long, ByVal lpString As Long, ByVal nCount As Long, lpRect As RECT, ByVal uFormat As Long) As Long
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
godeny
Lieutenant
Posts: 18
Joined: 28 Nov 2007, 19:44
Contact:

Post by godeny »

Yes, when i find nothing, then remains that way.

I have an existing application without unicode support i want to change. So it would be easier to replace the existing VB label controls with another control.
Post Reply