以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 下列代码怎么会弹出两次“提示窗口”啊? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=144610) |
-- 作者:hongye -- 发布时间:2019/12/25 12:49:00 -- 下列代码怎么会弹出两次“提示窗口”啊? Dim a As WinForm.TextBox = Forms("窗口1").Controls("TextBox1") Dim b As WinForm.TextBox = Forms("窗口1").Controls("TextBox2") Dim c As WinForm.Label = Forms("窗口1").Controls("Label1") Dim d As WinForm.Label = Forms("窗口1").Controls("Label2") Dim hj As WinForm.Label = e.Form.Controls("Label3") Dim f As WinForm.CheckBox = Forms("窗口1").Controls("CheckBox1") Dim r As Row = Tables("表A").Current If a.Value + 200 - 70 > 0 c.text = a.Value + 200 - 70 r("第四列") = c.text Else c.text = Nothing r("第四列") = Nothing End If If c.text + 20 - 70 * 15> 0 b.text = c.text + 20 - 70 * 15 r("第二列") = b.text Else b.text = Nothing r("第二列") = Nothing End If If b.Value + CDec(c.text)> 0 d.text = b.Value + CDec(c.text) r("第五列") = d.text Else d.text = Nothing r("第五列") = Nothing End If Dim a1 As Double = Val(CDec(c.text)) Dim a2 As Double = Val(CDec(d.text)) If a1 + a2 > 0 hj.text = a1 + a2 r("第六列") = hj.text Else hj.text = Nothing r("第六列") = Nothing End If Dim a3 As Double = Val(CDec(a.Value) + CDec(b.Value)) MessageBox.Show(a3,"提示")
|
-- 作者:有点蓝 -- 发布时间:2019/12/25 14:00:00 -- 代码放在什么事件? 可能是表格或者控件赋值后又触发了其它事件引起的
|
-- 作者:hongye -- 发布时间:2019/12/25 14:07:00 -- ValueChanged事件里 |
-- 作者:有点蓝 -- 发布时间:2019/12/25 15:00:00 -- 把和这个表,列有关的其它事件屏蔽试试 |