每当我尝试这个编码时,输入值就会变成$0.00。
Private Sub btnEnt_Click(sender As Object, e As EventArgs) Handles btnEnt.Click
Dim result As String
Dim earn As Decimal
txtEarning.Text = earn.ToString("C")
result = txtFName.Text & " " & txtLName.Text & " Worked" & vbCrLf
result &= nudHr.Value & " Hrs today"
result &= " and his earning is " & txtEarning.Text
txtRes.Text = result
End Sub
不显示输入值,而是自动转换为$0. 00。
我想你可能需要这个。
Dim earn as Decimal = nudHr.Value * 20
如果你的人每小时赚20美元