Results 1 to 5 of 5

Thread: [RESOLVED] Check if all characters are uppercase

  1. #1

    Thread Starter
    Member vali20's Avatar
    Join Date
    Feb 2008
    Posts
    58

    Resolved [RESOLVED] Check if all characters are uppercase

    Hello everyone, I have a list box control on my form. When I click on something on the list box, I want to determine if the text of the item I've clicked in the list box is uppercase or not (even if the text is HELLO WORLD! and it contains a space between HELLO and WORLD and an exclamation mark, it should be marked as uppercase and the program should display a message like: "The text you've clicked is uppercase"). I don't know how to get this! Can someone help me? Thanks in advance!
    If I left you in trouble, ask me for more explanations.

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

    Re: Check if all characters are uppercase

    Easiest way: If StrComp(UCase$(List1.List(x)), List1.List(x), vbBinaryCompare)=0 Then ' match identically

    Edited: The above is generic & does not depend on any OPTION COMPARE statements added to top of your code page.
    If you only want to compare the selected listbox item, replace .List(x) with .Text
    Last edited by LaVolpe; Jun 13th, 2011 at 02:02 PM.
    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
    Member vali20's Avatar
    Join Date
    Feb 2008
    Posts
    58

    Re: Check if all characters are uppercase

    Thank You very much LaVolpe! It works perfect! I had no problem implementing the code in my app. Thank You very much!

    Greetings from Romania!
    If I left you in trouble, ask me for more explanations.

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

    Re: Check if all characters are uppercase

    You are welcome. If this is resolved, please mark it resolved using the "Thread Tools" menu near top of your first post.

    Romania? Your English skills are very impressive
    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}

  5. #5

    Thread Starter
    Member vali20's Avatar
    Join Date
    Feb 2008
    Posts
    58

    Re: [RESOLVED] Check if all characters are uppercase

    Thank You very much and thanks again for the great code You posted here.
    If I left you in trouble, ask me for more explanations.

Tags for this Thread

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