Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Localing in VB (again)

  • 09-05-2001 02:56PM
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    What version of VB are you using? The latest version should support unicode fine.

    Also what operating system are you using and what is it's locale set to?

    Also the fonts on the command button, you are using a Unicode font? (I assume you are).


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    It's VB6

    On NT 4 can't even set the local to Japan although we can display japanese characters (see below).
    On Win 2000 we can set the local but it doesn't make any difference, the characters display fine in a resource file but not on the buttons.

    The fonts we've been using are Fixedsys, System and MSGothic (as recommended my microsoft). We can display the characters on a form with MSGothic using an API call, but this call doesn't work for command buttons as they don't have a device context handle. So aaaaaaaagh!, I came to this f*cking company to code in Java and get away from windows but because if my windows experience I get all these sh*tty jobs in vb. Japanese ffs! mad.gif

    Anyway, any help would be much appreciated.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Blah... spoke to a Japanese developer here.

    Should work fine, try writing the program on a Japanese operating system. At a guess your font isn't mapping correctly.



  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Tried that, and it didn't work for the buttons or labels, it did work for the caption bar. I think I'll need a japanese version of VB, b*llox.


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Thought I'd start a new topic for this one:

    Vb's command buttons do not support unicode, apparently. Does anybody know where I can find a replacement?


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Right,

    If you set the controls characters set to SHIFT-JIS (value of 128) and set the font to FixedSys it will display Japanese characters.
    Const SHIFT_JIS = 128
    
    Private Sub Form_Load()
    
        With Command1
           .Font.Charset = SHIFT_JIS
           .Font.Name = "FixedSys"
           .Caption = LoadResString(101) '// Where res string is japanese characters
        End With
    
    End Sub
    


    phweeew! thank god that's over.


    [edited to fix syntax error]

    [This message has been edited by Evil Phil (edited 11-05-2001).]


  • Advertisement
Advertisement