fast vb help
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts
Page 1 of 1
hey i know this might just be 1 letter but idk what it is or how to do it, i want to do
If textbox1.text = "airplane" or "plane" then
frmPlane.show()
end if
this is just a random example but the or doesn't work, if i put it it would mess up my program, is there any way to do
If textbox1.text = "123" or "321" or "1234" like 3 or more ?
pls tell
If textbox1.text = "airplane" or "plane" then
frmPlane.show()
end if
this is just a random example but the or doesn't work, if i put it it would mess up my program, is there any way to do
If textbox1.text = "123" or "321" or "1234" like 3 or more ?
pls tell
Use OrElse
Code: Select all
Or Use AndAlsoif textbox1.text = "airplane" OrElse "plane" then
frmPlane.show()
End if
Code: Select all
if textbox1.text = "airplane" AndAlso "plane" then
frmPlane.show()
End if
Find my programs on Softpedia
try to do it like this:
declare the string for the specific textbox:
if textbox1.text = "airplane" or textbox1.text="plane" then
frmPlane.show()
end if
or=============
declare the string for the specific textbox:
if textbox1.text = "airplane" or textbox1.text="plane" then
frmPlane.show()
end if
or=============
Code: Select all
If textbox1.text = "123" or textbox1.text = "321" or textbox1.text = "1234" then
form2.show
end if
Depending what you want to compare, there are quite a few functions (or logics to be precise).
Case #1: Integer and Integer (e.g. 2 and 4)
Case #1: Integer and Integer (e.g. 2 and 4)
Code: Select all
Case #2: Integer and Integer but provided as a string.Dim a As Integer = 2
Dim b As Integer = 4
If a = b Then
' Do something.
End If
Code: Select all
Case #3: String and StringDim aString As String = "2"
Dim bString As String = "4"
Dim a As Integer = Integer.Parse(aString)
Dim b As Integer = Integer.Parse(bString)
If a = b Then
' Do Something
End If
Code: Select all
That sums up all I can think of right now. For more, PM me ;)Dim a As String = "helloWorld"
Dim b As String = "howAreYou"
If a.Equals(b) Then
' Do Something
End If
' Another approach can be
If a = b Then
' Do something
End If
Like this
Code: Select all
If TextBox1.Text = "1" Or TextBox1.Text = "2" Or TextBox1.Text = "3" Then
frmPlane.show()
End If
You can find me on Facebook or on Skype mihai_92b
thanks all im sorry visualtech u r very helpful but it was not my question but i like it ty loove; loove; loove;
XTech and other has wht i want thanks loove; :oops:
XTech and other has wht i want thanks loove; :oops:
8 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023