Results 1 to 12 of 12

Thread: Command Button

  1. #1

    Thread Starter
    Hyperactive Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    267

    Question Command Button

    I am running VB6 on WIN10 Home. Is it possible to enter Unicode into command button caption, either via code or directly thru the command button properties? I have tried , but the Unicode value does not get translated.

    I can enter Unicode in Word 2003 and notepad. I cave not tried in Excel 2003 or Access 2003.

    Thanks

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,102

    Re: Command Button

    Via code, you can try: SetWindowText or sending it to that control's default windows procedure. But that may only work if the project is manifested for common controls and Windows is themed. Search for a quick example of using unicode captions in the form's titlebar. The logic should be the same.

    Otherwise, you may want to consider a unicode-compatable replacement. Krool has them in the codebank. Others may exist also.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Hyperactive Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    267

    Re: Command Button

    I found Arial Unicode MS font on my WIN7 computer. I copied it to my WIN10. Using control InkEdit, I can get the translation to work. It still needs more work!

  4. #4
    Member
    Join Date
    Mar 2020
    Posts
    32

    Re: Command Button

    make blank button and put label on top

  5. #5

    Thread Starter
    Hyperactive Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    267

    Re: Command Button

    The label box is not Unicode aware. Olga55, when you say on top. I presume you mean over, NOT higher up on the form. ZOrder does not seem to work here.

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,102

    Re: Command Button

    Yes, olga doesn't to quite have a grasp on VB yet.

    As far as using APIs, I gave it a quick try using SetWindowText and DefWindowProc APIs -- didn't work when app is themed and manifested; but wasn't sure it would either. Though the latter API can work for form captions in that scenario.

    Looking like you may want a unicode-compatible command button. Remember, appearance of VB controls are not naturally unicode compatible.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    Hyperactive Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    267

    Re: Command Button

    I changed the command buttons to picture boxes. These do not need to be Unicode compatible. I put pictures on the boxes. I use the Pic_Click routine to set the Unicode with ChrW$(####). Another touting translates the code for display.

  8. #8

  9. #9

    Thread Starter
    Hyperactive Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    267

    Re: Command Button

    Thank you Olga55 for your suggestion in Post#8. Until I can fully understand your recommendation, I will continue with my with Post #7.

    Ok, so now I an using picture boxes to get to the unicode character to display. Sometimes I need tto display two characters in one place. I have the Unicode characters for both characters. Any suggestions, how I can do this?

    Thanks

  10. #10
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,102

    Re: Command Button

    Two characters in one place? Not visualizing that. Are you talking about overlapping them? Otherwise, use .CLS ?

    The picturebox as a .CurrentX & .CurrentY property. That would be needed to position the picturebox for drawing at a specific location.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  11. #11

    Thread Starter
    Hyperactive Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    267

    Re: Command Button

    I am trying (for fun and education) to write create on the screen a keyboard in Hebrew. It is easy to get the codes for the Hebrew characters. However, in Hebrew,the vowels are placed underneath the letter. All letters are considered consonants. So lets suppose that a Hebrew letter is "A". A vowel could be the "ah" sound. It is displayed as "_". (of course no quotes). But there are a lot of letters and a lot of vowels. A keyboard could not be large enough. I can use the Left Alt key and the key that has the vowel. Now I have to mate the two piece, through the Unicode in wither hex or dec to get together in one place.

  12. #12

    Thread Starter
    Hyperactive Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    267

    Re: Command Button

    I have found how to put two characters in the same place. I just use code as
    "strCharCode = ChrW$(1493) & ChrW$(1468)".

    As long as the second character is a vowel, both characters are displayed in 1 position. If the two characters are not vowels, they display in two adjacent positions.

    I can get the display to go right to left as it should, but I cannot get the first character to start at the right side of the InkEdit control.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width