Re: IF AND THEN ELSE problem
Re: IF AND THEN ELSE problem
Thanks mate now im gonna get no help.
I marked that one as resolved because no body was replying
Re: IF AND THEN ELSE problem
See this thread http://www.vbforums.com/showpost.php...51&postcount=8 for some good advice on dealing with cards.
The first problem you need to address is your checks. What if "B" is in textbox1? Is that greater than 21?
Re: IF AND THEN ELSE problem
Doesn't look like it was marked resolved to me.
Re: IF AND THEN ELSE problem
Hi,
You can try this;
vb Code:
If TextBox6.Text > 21 And TextBox1.Text = 11 Then
TextBox1.Text = 1
End If
If TextBox6.Text > 21 And TextBox2.Text = 11 Then
TextBox2.Text = 1
End If
If TextBox6.Text > 21 And TextBox3.Text = 11 Then
TextBox3.Text = 1
End If
If TextBox6.Text > 21 And TextBox4.Text = 11 Then
TextBox4.Text = 1
End If
If TextBox6.Text > 21 And TextBox5.Text = 11 Then
TextBox5.Text = 1
End If
Re: IF AND THEN ELSE problem
Oh my apologies I thought I did i'll redo it
Re: IF AND THEN ELSE problem
No that doesn't work unfortunately?
Re: IF AND THEN ELSE problem
Quote:
Originally Posted by
martyloo
No that doesn't work unfortunately?
Hi,
In my application it does work in this button click event:
vb.net Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox6.Text > 21 And TextBox1.Text = 11 Then
TextBox1.Text = 1
End If
If TextBox6.Text > 21 And TextBox2.Text = 11 Then
TextBox2.Text = 1
End If
If TextBox6.Text > 21 And TextBox3.Text = 11 Then
TextBox3.Text = 1
End If
If TextBox6.Text > 21 And TextBox4.Text = 11 Then
TextBox4.Text = 1
End If
If TextBox6.Text > 21 And TextBox5.Text = 11 Then
TextBox5.Text = 1
End If
End Sub
Can explain a little more what's wrong and witch error you got.
Re: IF AND THEN ELSE problem
Ok i think i have something working now, i'll finish it off and let you know
Re: IF AND THEN ELSE problem
Could we at least pretend that we know the difference between strings and integers?
Make
Option Strict On
the first line of your program and you will see how bad it is.
At a minimum it should look like this
Code:
If CInt(TextBox6.Text) > 21 AndAlso CInt(TextBox1.Text) = 11 Then
TextBox1.Text = "1"
End If
though it does nothing for the case where the user enters something other than numbers into a textbox. See Integer.TryParse, please.
Re: IF AND THEN ELSE problem
why does it have to be like that? what is the difference they both appear to do the same function