BOTELHO19 Posted January 11, 2017 at 06:03 PM Report Share #601954 Posted January 11, 2017 at 06:03 PM Tenho este código e necessitava de fazer um botão para o utilizador meter um número e confirmar se é o que gerou na TextBox1 TextBox2 ate ao fim Para dizer se ganhou ou não Por favor se alguém souber me diga Obrigado... Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub gerarchave_Click(sender As Object, e As EventArgs) Handles gerarchave.Click Dim value0 As Integer Dim value1 As Integer Dim value2 As Integer Dim value3 As Integer Dim value4 As Integer Dim value5 As Integer Dim value6 As Integer Dim value7 As Integer value0 = (50 * Rnd() + 1) value1 = (50 * Rnd() + 1) value2 = (50 * Rnd() + 1) value3 = (50 * Rnd() + 1) value4 = (50 * Rnd() + 1) value5 = (50 * Rnd() + 1) value6 = (9 * Rnd() + 1) value7 = (9 * Rnd() + 1) TextBox1.Text = value0 TextBox2.Text = value1 TextBox3.Text = value2 TextBox4.Text = value3 TextBox5.Text = value4 TextBox6.Text = value5 TextBox7.Text = value6 TextBox6.BackColor = Color.Gold TextBox7.BackColor = Color.Gold End Sub Private Sub Utilizador_Click(sender As Object, e As EventArgs) Handles Utilizador.Click End Sub End Class Link to comment Share on other sites More sharing options...
He B TeMy Posted January 12, 2017 at 01:34 PM Report Share #601967 Posted January 12, 2017 at 01:34 PM Usas o If statement... If textbox1.text = textbox2.text Then 'código End If 'ou if textbox1.text = value.toString() Then 'código End if Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now