0

I want to have a code that the user can only input 1 of the 4 rooms. I tried many ways, but I got stucked up. this is the code of my form rooms.

Public Class formsnacks
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnbackkk.Click
    Me.Hide()
    Formrooms.Show()
    Dim itemcost(30)
End Sub

Private Sub btnincf_Click(sender As Object, e As EventArgs) Handles btnincf.Click
    lblfries.Text += 1
    If lblfries.Text >= 10 Then
        lblfries.Text = 10
    End If

End Sub

Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    lblfries.BackColor = ColorTranslator.FromHtml("#100F0E")
    lblburger.BackColor = ColorTranslator.FromHtml("#100F0E")
    lblcupcake.BackColor = ColorTranslator.FromHtml("#100F0E")
    lblpizza.BackColor = ColorTranslator.FromHtml("#100F0E")
End Sub

Private Sub btndecf_Click(sender As Object, e As EventArgs) Handles btndecf.Click
    lblfries.Text -= 1
    If lblfries.Text <= 0 Then
        lblfries.Text = 0
    End If
End Sub

Private Sub btndecc_Click(sender As Object, e As EventArgs) Handles btndecc.Click
    lblcupcake.Text -= 1
    If lblcupcake.Text <= 0 Then
        lblcupcake.Text = 0
    End If
End Sub

Private Sub btnincc_Click(sender As Object, e As EventArgs) Handles btnincc.Click
    lblcupcake.Text += 1
    If lblcupcake.Text >= 10 Then
        lblcupcake.Text = 10
    End If
End Sub

Private Sub btndecb_Click(sender As Object, e As EventArgs) Handles btndecb.Click
    lblburger.Text -= 1
    If lblburger.Text <= 0 Then
        lblburger.Text = 0
    End If

End Sub

Private Sub btnincb_Click(sender As Object, e As EventArgs) Handles btnincb.Click
    lblburger.Text += 1
    If lblburger.Text >= 10 Then
        lblburger.Text = 10
    End If
End Sub

Private Sub btndecp_Click(sender As Object, e As EventArgs) Handles btndecp.Click
    lblpizza.Text -= 1
    If lblpizza.Text <= 0 Then
        lblpizza.Text = 0
    End If

End Sub

Private Sub btnincp_Click(sender As Object, e As EventArgs) Handles btnincp.Click
    lblpizza.Text += 1
    If lblpizza.Text >= 10 Then
        lblpizza.Text = 10
    End If
End Sub

I want to lock a button if one of 4 rooms have already have value. This is the one of the 5 major problems I had on my system. It is too difficult for me as a young student.

New contributor
Kurt Jhaive is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

Kurt Jhaive is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.