I want to ask how to accept more than "one" values typed into a
textbox...
For example:
If TextBox1.Text = "Google" Then
MsgBox("You're RIGHT", vbInformation, "Great")
Else : MsgBox("You're WRONG", vbCritical, "Bad")
The question is because VB.NET is not case sensitive as i detected
(maybe wrong, don't know), instead of "Google", i want my program
accept also "gOOgle" or "GOOGLE" or "GoOgGLe"....
How to declare equality or these type of strings?
Thanks. 8 1575
Try using "ToUpper"
Example
If TextBox1.Text.ToUpper = "GOOGLE" Then
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
>I want to ask how to accept more than "one" values typed into a
textbox...
For example:
If TextBox1.Text = "Google" Then
MsgBox("You're RIGHT", vbInformation, "Great")
Else : MsgBox("You're WRONG", vbCritical, "Bad")
The question is because VB.NET is not case sensitive as i detected
(maybe wrong, don't know), instead of "Google", i want my program
accept also "gOOgle" or "GOOGLE" or "GoOgGLe"....
How to declare equality or these type of strings?
Thanks.
On Aug 5, 12:28 am, "Matt F" <mfielderREMOVEC...@nospam.nospamwrote:
Try using "ToUpper"
Example
If TextBox1.Text.ToUpper = "GOOGLE" Then
"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
I want to ask how to accept more than "one" values typed into a
textbox...
For example:
If TextBox1.Text = "Google" Then
MsgBox("You're RIGHT", vbInformation, "Great")
Else : MsgBox("You're WRONG", vbCritical, "Bad")
The question is because VB.NET is not case sensitive as i detected
(maybe wrong, don't know), instead of "Google", i want my program
accept also "gOOgle" or "GOOGLE" or "GoOgGLe"....
How to declare equality or these type of strings?
Thanks.- Hide quoted text -
- Show quoted text -
Matt,
Your advise is worked for uppering cases thanks but,
how to create a OR instance for strings? For example "Or" cannot be
used for strings,may be used just for Booleans as i got, i received
errors.
So, how to make my program accept "GOOGLE" and "YAHOO" or "LYCOS"
together??? When one of them is entered, i want not to have any
problem...
"kimiraikkonen" <ki*************@gmail.comschrieb:
>I want to ask how to accept more than "one" values typed into a
textbox...
For example:
If TextBox1.Text = "Google" Then
MsgBox("You're RIGHT", vbInformation, "Great")
Else : MsgBox("You're WRONG", vbCritical, "Bad")
The question is because VB.NET is not case sensitive as i detected
(maybe wrong, don't know), instead of "Google", i want my program
accept also "gOOgle" or "GOOGLE" or "GoOgGLe"....
You may want to enable 'Option Compare Text' for the code file, or you may
wan to use 'String.Compare' with appropriate compare options.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
On Aug 5, 12:49 am, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb:
I want to ask how to accept more than "one" values typed into a
textbox...
For example:
If TextBox1.Text = "Google" Then
MsgBox("You're RIGHT", vbInformation, "Great")
Else : MsgBox("You're WRONG", vbCritical, "Bad")
The question is because VB.NET is not case sensitive as i detected
(maybe wrong, don't know), instead of "Google", i want my program
accept also "gOOgle" or "GOOGLE" or "GoOgGLe"....
You may want to enable 'Option Compare Text' for the code file, or you may
wan to use 'String.Compare' with appropriate compare options.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
How to? Could you example it?
On 4 Ago, 23:22, kimiraikkonen <kimiraikkone...@gmail.comwrote:
I want to ask how to accept more than "one" values typed into a
textbox...
For example:
If TextBox1.Text = "Google" Then
MsgBox("You're RIGHT", vbInformation, "Great")
Else : MsgBox("You're WRONG", vbCritical, "Bad")
The question is because VB.NET is not case sensitive as i detected
(maybe wrong, don't know), instead of "Google", i want my program
accept also "gOOgle" or "GOOGLE" or "GoOgGLe"....
How to declare equality or these type of strings?
Thanks.
With StringComparer.CurrentCultureIgnoreCase
Dim SpiderTyped = Me.TextBox1.Text.Trim
If .Compare(SpiderTyped, "Google") = 0 OrElse _
.Compare(SpiderTyped, "Yahoo") = 0 OrElse _
.Compare(SpiderTyped, "Lycos") = 0 Then
'it's one of the 3
Else
'otherwise
End If
End With
'or StringComparer.InvariantCultureIgnoreCase
Each item in an "Or" needs both sides of the equation - see example below to
get you started.
It seems like you're a little new to development. You might be well served
by finding a good text on introductory VB.Net programming.
Example:
If TextBox1.Text.ToUpper = "GOOGLE" Or TextBox1.Text.ToUpper = "YAHOO" Then
Your advise is worked for uppering cases thanks but,
how to create a OR instance for strings? For example "Or" cannot be
used for strings,may be used just for Booleans as i got, i received
errors.
So, how to make my program accept "GOOGLE" and "YAHOO" or "LYCOS"
together??? When one of them is entered, i want not to have any
problem...
>
So, how to make my program accept "GOOGLE" and "YAHOO" or "LYCOS"
together??? When one of them is entered, i want not to have any
problem...
Why not use Radio buttons or a select list to allow user to choose one
On Aug 5, 6:47 am, "Hal Rosser" <hmros...@bellsouth.netwrote:
So, how to make my program accept "GOOGLE" and "YAHOO" or "LYCOS"
together??? When one of them is entered, i want not to have any
problem...
Why not use Radio buttons or a select list to allow user to choose one
However, i managed to do this but adding "elseIf" statement, all is OK
now.
Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ayende Rahien |
last post by:
I've a really strange problem, in some part of my code I compare two
strings (through object), and while I *know* that they equal each
other, and in the watch window they do equal each other, then...
|
by: FAQ server |
last post by:
-----------------------------------------------------------------------
FAQ Topic - Why does 1+1 equal 11? or How do I convert a
string to a number?...
|
by: FAQ server |
last post by:
-----------------------------------------------------------------------
FAQ Topic - Why does 1+1 equal 11? or How do I convert a
string to a number?...
|
by: FAQ server |
last post by:
-----------------------------------------------------------------------
FAQ Topic - Why does 1+1 equal 11? or How do I convert a
string to a number?...
|
by: FAQ server |
last post by:
-----------------------------------------------------------------------
FAQ Topic - Why does 1+1 equal 11? or How do I convert a
string to a number?...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |