以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 求助 DataColChanged (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=71341) |
-- 作者:lingyun00800 -- 发布时间:2015/7/9 16:16:00 -- 求助 DataColChanged If e.DataCol.Name = "选择题_A选项" Then If e.NewValue = True Then e.DataRow("正确答案") = "A" Else e.DataRow("正确答案") = "" End If End If If e.DataCol.Name = "选择题_B选项" Then If e.NewValue = True Then e.DataRow("正确答案") = "B" Else e.DataRow("正确答案") = "" End If End If If e.DataCol.Name = "选择题_C选项" Then If e.NewValue = True Then e.DataRow("正确答案") = "C" Else e.DataRow("正确答案") = "" End If End If If e.DataCol.Name = "选择题_D选项" Then If e.NewValue = True Then e.DataRow("正确答案") = "D" Else e.DataRow("正确答案") = "" End If End If If e.DataCol.Name = "选择题_E选项" Then If e.NewValue = True Then e.DataRow("正确答案") = "E" Else e.DataRow("正确答案") = "" End If End If 我这么做是单选。如果是多选怎么写。 |
-- 作者:大红袍 -- 发布时间:2015/7/9 16:23:00 -- Select Case e.DataCol.Name Case "选择题_A选项","选择题_B选项","选择题_C选项","选择题_D选项","选择题_E选项" Dim str As String = "" If e.DataRow("选择题_A选项") = True Then str &= "A," End If If e.DataRow("选择题_B选项") = True Then str &= "B," End If If e.DataRow("选择题_C选项") = True Then str &= "C," End If If e.DataRow("选择题_D选项") = True Then str &= "D," End If If e.DataRow("选择题_E选项") = True Then str &= "E," End If e.DataRow("正确答案") = str.Trim(",") End Select |