VB.NET Help - Checking If Textbox Contains Text

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.
10 posts Page 1 of 1
Contributors
User avatar
codedrive
VIP - Donator
VIP - Donator
Posts: 28
Joined: Tue Jul 17, 2012 5:25 pm

Hey #code it and #codedrive (me) are working on a project where you register! We need to know wuts the code to check if a textbox contains text, i thought
Code: Select all
If textbox.text.contains letters then
but it's not working! we have 5 textbox's and we need it all in one If!
Image
User avatar
DeveloperJacob
VIP - Donator
VIP - Donator
Posts: 87
Joined: Sun May 27, 2012 12:40 pm

Try this:
Code: Select all
If not textbox.text = nothing then
Image
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

codedrive wrote:
Hey #code it and #codedrive (me) are working on a project where you register! We need to know wuts the code to check if a textbox contains text, i thought
Code: Select all
If textbox.text.contains letters then
but it's not working! we have 5 textbox's and we need it all in one If!
what about
Code: Select all
if textbox.text < "" then
end if
https://t.me/pump_upp
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

Wrote in browser soo might be alittle off but this should work
Code: Select all
dim I as textbox in me.controls
if type of I.text.contains = "1" then
'do something
end if
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Code: Select all
If TextBox1.Text <> Nothing Then
'Textbox contains something
Else
'Textbox is empty
End If
Or
Code: Select all
If TextBox1.text.lenght = 0 Then
'Textbox is empty
else
'Textbox contains something
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
Matt
VIP - Donator
VIP - Donator
Posts: 158
Joined: Fri Jul 22, 2011 5:44 pm

try
Code: Select all
if textbox.text = "" then
msgbox"text box does not contain any text"
as an example.
This has always helped me out.

+rep if I helped you :-)
Formerly known as RyggTonning.
PM me if you have any business proposals or similar.
User avatar
codedrive
VIP - Donator
VIP - Donator
Posts: 28
Joined: Tue Jul 17, 2012 5:25 pm

I need it like i have 5 textbox's! I need on


If
End If

so it can check first to see if there all filled out then if its right it does a code :?
Image
User avatar
bisnes_niko
Serious Programmer
Serious Programmer
Posts: 409
Joined: Tue Aug 24, 2010 1:21 pm

Code: Select all
        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Then
            MsgBox("some are empty")
        Else
            MsgBox("none of them are empty")
            'continue registration...
        End If
User avatar
codedrive
VIP - Donator
VIP - Donator
Posts: 28
Joined: Tue Jul 17, 2012 5:25 pm

bisnes_niko wrote:
Code: Select all
        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Then
            MsgBox("some are empty")
        Else
            MsgBox("none of them are empty")
            'continue registration...
        End If
I also need it to check a textbox would i use this code

so i have the or's


,,,,,, And CaptchaConfirm.text=Captchacode.text , Would i use that to check if a code was entered right? THX to #MrAksel for Captcha system
Image
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Code: Select all
If (TextBox1.Text + TextBox2.Text + TextBox3.Text + TextBox4.Text + TextBox5.Text).Contains("letters") Then
End If
And yes, you would be able to check if the captcha is correct your way.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
10 posts Page 1 of 1
Return to “Coding Help & Support”