-3
我有一个文本框,其值为0.00,然后我得到了一个错误转换...但我 已经做了0.00不是从文本框,它的工作..如何修复这个问题?从十进制字符串的错误
Dim _Total, _Deduct, _Charges As String
Dim _sss, _tax, _pf, _ph, _loan, _others, _hdmf, _cola, _allowance As Decimal
这行,如果文本框和注释此行是工作..但我用这个不工作..
_sss = txtSSS.Text : _ph = txtPH.Text : _tax = txtInTax.Text : _pf = txtPF.Text
_loan = txtLoan.Text : _hdmf = txtHDMF.Text : _others = txtOther.Text
_cola = txtCola.ToString : _allowance = txtAllowance.ToString
这行是我给出的示例值...相同的值,但文本框没有工作..这是工作
'This code when I uncomment.. this work..
'_sss = "0.00": _ph = "0.00" : _tax = "0.00" : _pf = "0.00"
'_loan = "0.00" : _hdmf = "50.00" : _others = "0.00"
'_cola = "0.00" : _allowance = "0.00"
_Charges = CDec(_cola) + CDec(_allowance)
_Deduct = CDec(_sss) + CDec(_tax) + CDec(_pf) + CDec(_ph) + CDec(_loan) + CDec(_hdmf) + CDec(_others)
_Total = CDec(_Charges) - CDec(_Deduct)
lblDeduct.Text = Format((_Deduct), "currency")
lblTotal.Text = FormatCurrency((_Total), 2, TriState.True, TriState.False, TriState.True)
嗯..先生..什么,如果文本框的值是动态的,可以通过改变textchange ..我真的DNT有一个好主意如何工作的.. TY的答复.. – 2012-07-16 02:25:58
@DeorwinBensurto把它放在TextBox的TextChanged事件 – 2012-07-16 02:27:21
仍然不知道修复这个先生的好方法..我实际上使用货币价值计算..但仍然不能解决.. – 2012-07-16 02:51:49