Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    'TextBox1.Text = Token()
    If Button1.Enabled = True Then
        Label1.Text = Label1.Text + " A1 "

        If Button1.BackColor = Color.Yellow Then
            Button1.BackColor = Color.Red
        Else
            Button1.BackColor = Color.Yellow
        End If

    Else
        Label2.Text = ""
        Label2.Text = True

    End If
    Button1.BackColor = Color.Yellow

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

    If Button2.Enabled = True Then
        Label1.Text = Label1.Text + " b1 "

        If Button1.BackColor = Color.Yellow Then
            Button1.BackColor = Color.Red
        Else
            Button1.BackColor = Color.Yellow
        End If

    Else
        Label2.Text = ""
        Label2.Text = True

    End If
    Button2.BackColor = Color.Yellow

End Sub

End Class

Recommended Answers

All 3 Replies

Your post is as friendly as some bus drivers. You pull up, dump, and drive off without a word.

At the end of the subs you are overriding the conditional test.
The buttons are going to be yellow no matter what.
Not even sure this is what you are trying to solve as there is no info about the problem!

commented: Sir Mike_68 I'm sorry . the problem is , if there are 3 seat to be book , the user can only select 3 seat in the seat plan. +0
commented: Is that you "Carnac the Magnificent"? +15

If there are only three seats to be booked, why would you want to choose other than three?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.