试图为我工作的酒吧制作VB收银机 [英] Trying to make VB Cash Register for a bar I work at

查看:50
本文介绍了试图为我工作的酒吧制作VB收银机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,
因此,我让所有计算器按钮都能正常工作,并以txt形式显示它们,以便我可以使用点击产品按钮的值,唯一的问题是我无法正常工作.我不知道如何使按钮点击重置,所以我可以说1美元一瓶啤酒,2美元瓶和3美元鸡尾酒,并告诉我总共6美元,但仍然总共给我3次按钮点击.在啤酒和通话饮料的按钮上,我尝试了两种可以查看的方法.任何帮助将不胜感激.

Ok,
So I got all of the calculator buttons to work properly and display them in a txt so that I could use the values for the click of the product buttons, only problem is I can''t get the thing to work properly. I cant figure out how to make the button clicks reset so i can use say 1$ bottle of beer along with 2$ bottle and a 3$ cocktail and have it tell me 6$ total but still give me a total of 3 button clicks. On the buttons for beer and call drinks I have tried two different approaches that you can look at. Any help would be greatly appreciated.

Public Class frmBar

    Private Sub Button1_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub LblTitle_Click(sender As Object, e As EventArgs) Handles LblTitle.Click

    End Sub

    Private Sub ButtonNum9_Click(sender As Object, e As EventArgs) Handles btnNum9.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum9.Text
    End Sub

    Private Sub btnHHWell_Click(sender As Object, e As EventArgs) Handles btnHHWell.Click

    End Sub

    Private Sub btnNum0_Click(sender As Object, e As EventArgs) Handles btnNum0.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum0.Text
    End Sub

    Private Sub btnNum1_Click(sender As Object, e As EventArgs) Handles btnNum1.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum1.Text
    End Sub

    Private Sub btnNum2_Click(sender As Object, e As EventArgs) Handles btnNum2.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum2.Text
    End Sub

    Private Sub btnNum3_Click(sender As Object, e As EventArgs) Handles btnNum3.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum3.Text
    End Sub

    Private Sub btnNum4_Click(sender As Object, e As EventArgs) Handles btnNum4.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum4.Text
    End Sub

    Private Sub btnNum5_Click(sender As Object, e As EventArgs) Handles btnNum5.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum5.Text
    End Sub

    Private Sub btnNum6_Click(sender As Object, e As EventArgs) Handles btnNum6.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum6.Text
    End Sub

    Private Sub btnNum7_Click(sender As Object, e As EventArgs) Handles btnNum7.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum7.Text
    End Sub

    Private Sub btnNum8_Click(sender As Object, e As EventArgs) Handles btnNum8.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNum8.Text
    End Sub

    Private Sub btnNumDot_Click(sender As Object, e As EventArgs) Handles btnNumDot.Click
        txtPriceFirst.Text = txtPriceFirst.Text & btnNumDot.Text
    End Sub

    Private Sub btnNumClr_Click(sender As Object, e As EventArgs) Handles btnNumClr.Click
        txtPriceFirst.Text = ""
    End Sub

    Dim intBtnClkCount1 As Integer = 0
    Dim decPriceFirst As Decimal = 0
    Dim decPriceFinal As Decimal = 0

    Private Sub btnBottle_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBottle.Click
        decPriceFirst = CType(txtPriceFirst.Text, Decimal)
        decPriceFinal = CType(txtPriceFinal.Text, Decimal)
        intBtnClkCount1 += 1
        If String.IsNullOrEmpty(txtPriceFinal.Text) Then
            txtPriceFinal.Text = (intBtnClkCount1 * decPriceFirst)
        Else
            txtPriceFinal.Text = (intBtnClkCount1 * decPriceFirst) + decPriceFinal
        End If
        txtTotal.Text = intBtnClkCount1 + intBtnClkCount2 + intBtnClkCount3 + intBtnClkCount4
    End Sub

    Dim intBtnClkCount2 As Integer = 0
    Private Sub btnWine_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnWine.Click
        decPriceFirst = CType(txtPriceFirst.Text, Decimal)
        intBtnClkCount2 += 1
        txtPriceFinal.Text = (intBtnClkCount2 * decPriceFirst)
        txtTotal.Text = intBtnClkCount1 + intBtnClkCount2 + intBtnClkCount3 + intBtnClkCount4
    End Sub

    Dim intBtnClkCount3 As Integer = 0
    Private Sub btnCall_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCall.Click
        decPriceFirst = CType(txtPriceFirst.Text, Decimal)
        intBtnClkCount3 += 1
        txtPriceFinal.Text = (intBtnClkCount3 * decPriceFirst) + decPriceFinal
        txtTotal.Text = intBtnClkCount1 + intBtnClkCount2 + intBtnClkCount3 + intBtnClkCount4
    End Sub

    Dim intBtnClkCount4
    Private Sub btnWell_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnWell.Click
        decPriceFirst = CType(txtPriceFirst.Text, Decimal)
        intBtnClkCount4 += 1
        txtPriceFinal.Text = (intBtnClkCount4 * decPriceFirst) + decPriceFinal
        txtTotal.Text = intBtnClkCount1 + intBtnClkCount2 + intBtnClkCount3 + intBtnClkCount4
    End Sub
End Class



http://s18.postimage.org/ah7ygirrt/Capture.png [



http://s18.postimage.org/ah7ygirrt/Capture.png[^]

推荐答案

瓶啤酒和2


瓶和3


鸡尾酒,并告诉我6


这篇关于试图为我工作的酒吧制作VB收银机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆