Foxtable(狐表)用户栏目专家坐堂 → 选择不同的RadioButton绑定不同的表和隐藏控件。


  共有2212人关注过本帖树形打印复制链接

主题:选择不同的RadioButton绑定不同的表和隐藏控件。

帅哥哟,离线,有人找我吗?
yangwenghd
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2701 积分:17999 威望:0 精华:0 注册:2013/4/9 10:41:00
  发帖心情 Post By:2016/8/12 11:06:00 [只看该作者]

谢谢 能帮我看看这个是那里错了啊?
选择不同的RadioButton 后 ComboBox1 提供不同表 列的参考数据和 Label5 显示不同的名称,感谢 感谢 

If e.Form.Controls("RadioButton1").Checked Then
    e.Sender.Controls = DataTables("表A").GetComboListString("第十列")
    e.Form.Controls("Label5").Visible = "名称"
    If e.Form.Controls("RadioButton2").Checked Then
        e.Sender.Controls = DataTables("表b").GetComboListString("第九列")
        e.Form.Controls("Label5").Visible = "姓名"
        If e.Form.Controls("RadioButton3").Checked Then
            e.Sender.Controls = DataTables("表c").GetComboListString("第八列")
            e.Form.Controls("Label5").Visible = "方式"
        End If
    End If
End If


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/12 11:20:00 [只看该作者]

If e.Form.Controls("RadioButton1").Checked Then
    e.Sender.Controls = DataTables("表A").GetComboListString("第十列")
    e.Form.Controls("Label5").Visible = "名称"
ElseIf e.Form.Controls("RadioButton2").Checked Then
    e.Sender.Controls = DataTables("表b").GetComboListString("第九列")
    e.Form.Controls("Label5").Visible = "姓名"
ElseIf e.Form.Controls("RadioButton3").Checked Then
    e.Sender.Controls = DataTables("表c").GetComboListString("第八列")
    e.Form.Controls("Label5").Visible = "方式"
End If

 回到顶部
帅哥哟,离线,有人找我吗?
yangwenghd
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2701 积分:17999 威望:0 精华:0 注册:2013/4/9 10:41:00
  发帖心情 Post By:2016/8/12 14:49:00 [只看该作者]

我把代码分开单独放到每个RadioButton里面。还是不能执行,是那个出了问题了啊 ,看了很久也没看出来。
If e.Form.Controls("RadioButton2").Checked Then
    e.Form.Controls("ComboBox1").Text = DataTables("表A").GetComboListString("第十列")
    e.Form.Controls("Label5").Visible = "名称改"
End If

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/12 14:58:00 [只看该作者]

If e.Form.Controls("RadioButton2").Checked Then
    e.Form.Controls("ComboBox1").ComboList = DataTables("表A").GetComboListString("第十列")
    e.Form.Controls("Label5").Text= "名称改"
End If
[此贴子已经被作者于2016/8/12 14:58:28编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
yangwenghd
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2701 积分:17999 威望:0 精华:0 注册:2013/4/9 10:41:00
  发帖心情 Post By:2016/8/12 21:47:00 [只看该作者]

感谢 感谢 可以了 感谢 

 回到顶部
总数 15 上一页 1 2