Mesbahullah13
New Member
- Joined
- Mar 14, 2023
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
I'm trying to add Percentage to my Calculator in VB but the Percentage(%) sign doesn't work it keeps saying "Character is not valid"
Heres my code
Public Class Form1
Private Sub btnPercentage_Click(sender As Object, e As EventArgs) Handles btnPercentage.Click
Dim iNumber1 As Integer
Dim iNumber2 As Integer
Dim iAns As Integer
'input
iNumber1 = txtNumber1.Text
iNumber2 = txtNumber2.Text
'processing
iAns = iNumber1 % iNumber2
'output
txtAnswer.Text = iAns
End Sub
End Class
Heres my code
Public Class Form1
Private Sub btnPercentage_Click(sender As Object, e As EventArgs) Handles btnPercentage.Click
Dim iNumber1 As Integer
Dim iNumber2 As Integer
Dim iAns As Integer
'input
iNumber1 = txtNumber1.Text
iNumber2 = txtNumber2.Text
'processing
iAns = iNumber1 % iNumber2
'output
txtAnswer.Text = iAns
End Sub
End Class