|
-
Jun 13th, 2011, 01:52 PM
#1
Thread Starter
Member
[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.
-
Jun 13th, 2011, 01:54 PM
#2
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.
-
Jun 13th, 2011, 02:01 PM
#3
Thread Starter
Member
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.
-
Jun 13th, 2011, 02:07 PM
#4
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
-
Jun 13th, 2011, 02:17 PM
#5
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|