以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 无法将类型为“Foxtable.WinForm.Label”的对象强制转换为类型“Foxtable.WinForm.TextBox” (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=134110) |
-- 作者:gaolei -- 发布时间:2019/4/27 18:41:00 -- 无法将类型为“Foxtable.WinForm.Label”的对象强制转换为类型“Foxtable.WinForm.TextBox” Dim b1 As WinForm.TextBox = e.Form.Controls("税额1") Dim b2 As WinForm.TextBox = e.Form.Controls("税额2") Dim b3 As WinForm.TextBox = e.Form.Controls("税额3") Dim b4 As WinForm.TextBox = e.Form.Controls("税额4") Dim b5 As WinForm.TextBox = e.Form.Controls("税率01") Dim b6 As WinForm.TextBox = e.Form.Controls("税率02") Dim b7 As WinForm.TextBox = e.Form.Controls("税率03") Dim b8 As WinForm.TextBox = e.Form.Controls("税率04") Dim c1 As String = b1.value Dim c2 As String = b2.value Dim c3 As String = b3.value Dim c4 As String = b4.value Dim c5 As String = b5.value Dim c6 As String = b6.value Dim c7 As String = b7.value Dim c8 As String = b8.value s2=val(c1) s3=val(c2) s4=val(c3) s5=val(c4) s6=val(c5) s7=val(c6) s8=val(c7) s9=val(c8) Dim aa() As Single ={s2,s3,s4,s5} Dim bb() As Single ={s6,s7,s8,s9} Dim f As Single For i As Integer = 0 To 3 If bb(i) <> 0 f =f + aa(i)/bb(i)*(1+bb(i)) End If NEXT 老师请教一下,这段代码老显示 无法将类型为“Foxtable.WinForm.Label”的对象强制转换为类型“Foxtable.WinForm.TextBox”。这个是为啥,我的代码里面明明没有label类型的窗口啊,打扰老师帮忙指点一下
|
-- 作者:gaolei -- 发布时间:2019/4/27 18:54:00 -- 老师,我找到原因了,不是代码的原因,代码没问题,打扰啦 |