以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]按顺序勾选问题? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=186320) |
-- 作者:KkZzxxx -- 发布时间:2023/4/21 17:11:00 -- [求助]按顺序勾选问题? 窗口如何重左到右按顺序勾选。写到第三个的时候关掉发现在打开已经锁死状态了 Dim RWXD As WinForm.CheckBox = e.Form.Controls("RWXD") \'设置窗口弹出时候,“任务下达”相关 Dim tba1() As WinForm.Control = {e.Form.Controls("HTCG"), e.Form.Controls("SHYJ"), e.Form.Controls("HTDG"), e.Form.Controls("HTCD")} Dim tba2() As WinForm.Control = {e.Form.Controls("SHYJ"), e.Form.Controls("HTDG"), e.Form.Controls("HTCD")} If RWXD.Checked Then For Each tb As WinForm.Control In tba2\'勾 tb.Enabled = False Next Else For Each tb As WinForm.Control In tba1\'没勾 tb.Enabled = False Next End If Dim HTCG As WinForm.CheckBox = e.Form.Controls("HTCG") \'设置窗口弹出时候,“合同初稿”相关 Dim tbS1() As WinForm.Control = {e.Form.Controls("SHYJ"), e.Form.Controls("HTDG"), e.Form.Controls("HTCD")} Dim tbS2() As WinForm.Control = {e.Form.Controls("HTDG"), e.Form.Controls("HTCD"), e.Form.Controls("RWXD")} If HTCG.Checked Then For Each ts As WinForm.Control In tbS2\'勾 ts.Enabled = False Next Else For Each ts As WinForm.Control In tbS1\'没勾 ts.Enabled = False Next End If Dim SHYJ As WinForm.CheckBox = e.Form.Controls("SHYJ") \'设置窗口弹出时候,“审核意见”相关 Dim tbW1() As WinForm.Control = {e.Form.Controls("HTDG"), e.Form.Controls("HTCD")} Dim tbW2() As WinForm.Control = {e.Form.Controls("HTCD"), e.Form.Controls("HTCG"), e.Form.Controls("RWXD")} If SHYJ.Checked Then For Each tq As WinForm.Control In tbW2\'勾 tq.Enabled = False Next Else For Each tq As WinForm.Control In tbW1\'没勾 tq.Enabled = False Next End If |
-- 作者:有点蓝 -- 发布时间:2023/4/21 17:12:00 -- 没看懂。请使用文字说明一下要做什么功能? |
-- 作者:KkZzxxx -- 发布时间:2023/4/21 17:14:00 -- 就是窗口中有5个控件 要从左到右按顺序勾选, |
-- 作者:cd_tdh -- 发布时间:2023/4/21 17:14:00 -- 既然是逐个按顺序勾选,就逐个判断啊,勾选第2个,判断第一个是否勾选,勾选第3个,判断第2个是否勾选,依次类推,不用循环所有按钮。 |
-- 作者:KkZzxxx -- 发布时间:2023/4/21 17:23:00 -- 额额额。。。 好像不行 能给个代码吗、 |
-- 作者:有点蓝 -- 发布时间:2023/4/21 17:28:00 -- for each s as string in {"控件名称1","控件名称2"} e.Form.Controls(s).checked = true next
|