Im making a calculator as a school project and I would like to know how to make it so that only 1 decimal is allowed in the textbox. The current code that need's changing is (And I know its basic but im just learning it):
Code:Private Sub btnNumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles btn0.Click, btn1.Click, btn2.Click, btn3.Click, btn4.Click, btn5.Click, btn6.Click, btn7.Click, btn8.Click, btn9.Click, btnDot.Click Dim btnNumberClicked As Button = sender 'Contains properties of clicked button If blnNewOp Then Me.txtDisplay.Text = btnNumberClicked.Tag blnNewOp = False Else Me.txtDisplay.Text = Me.txtDisplay.Text & btnNumberClicked.Tag End If End Sub




Reply With Quote
