In this Visual Basic tutorial, you'll learn to use conditional statements for the push-button validation of a designated text string. The code used in this example is as follows:
Dim Captain As String
Captain = TextBoxCaptain.Text
Captain = Captain.ToUpper
If Captain = "PICARD" Or Captain = "KIRK" Or Captain = "ARCHER" Or Captain = "PIKE" Or Captain = "JANEWAY" Then
MsgBox("Indeed, Warp Factor 9!")
Else
MsgBox(Captain & " has never been a Captain")
End If
For complete, step-by-step instructions on using IF statements in your own Visual Basic 2005 and 2008 Studio projects, watch this how-to.
Want to master Microsoft Excel and take your work-from-home job prospects to the next level? Jump-start your career with our Premium A-to-Z Microsoft Excel Training Bundle from the new Gadget Hacks Shop and get lifetime access to more than 40 hours of Basic to Advanced instruction on functions, formula, tools, and more.
Other worthwhile deals to check out:
- 97% off The Ultimate 2021 White Hat Hacker Certification Bundle
- 98% off The 2021 Accounting Mastery Bootcamp Bundle
- 99% off The 2021 All-in-One Data Scientist Mega Bundle
- 59% off XSplit VCam: Lifetime Subscription (Windows)
- 98% off The 2021 Premium Learn To Code Certification Bundle
- 62% off MindMaster Mind Mapping Software: Perpetual License
- 41% off NetSpot Home Wi-Fi Analyzer: Lifetime Upgrades
Be the First to Comment
Share Your Thoughts