how does one add up a total of textboxes using the enter keystroke to display the total in a label
keystroke
Collapse
X
-
I am using Visual Studio 2008.Originally posted by gobblegobwhat version ov visual basics are you using ?
GobbleGob.
what i want is jst to type in a value in the first textbox and when i press enter the label must hld that value and then if i add a value to the second textbox then they are added up and the label hold the valueComment
-
-
[code=text]
Private Sub TextBox1_KeyPre ss(ByVal sender As Object, ByVal e As System.Windows. Forms.KeyPressE ventArgs) Handles TextBox1.KeyPre ss
If Asc(e.KeyChar) = 13 Then
add()
End If
End Sub
Private Sub add()
Try
Label1.Text = CInt(Label1.Tex t) + CInt(TextBox1.T ext)
Catch
End Try
End Sub
[/code]Comment
Comment