.NET is case sensitive, that means that shutdown
is not the same as SHUTDOWN
. You can use Equals
with the overload that takes a StringComparison
:
If TextBox1.Text.Equals("SHUTDOWN", StringComparison.CurrentCultureIgnorecase) Then
TextBox2.Visible = True
End If
Another option in VB.NET only is to use OPTION Compare
on file- or on project level.
If you use this as first line in your file:
Option Compare Text
You get a case-insensitive comparison. However, i would prefer the .NET way.
Text: Results in string comparisons based on a case-insensitive text sort order determined by your system's locale. This type of comparison is useful if your strings contain all text characters, and you want to compare them taking into account alphabetic equivalences such as case insensitivity and closely related letters. For example, you might want to consider A and a to be equal, and Ä and ä to come before B and b.