以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 动态增加控件的问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=111790) |
-- 作者:SZCD111 -- 发布时间:2017/12/29 10:26:00 -- 动态增加控件的问题 请教: If e.Form.existcontrol("combobox3")=True Then Dim cmb3 As winform.combobox=e.Form.createcontrol("ComboBox3",controltypeenum.combobox) If cmb3.value Is Nothing Then messagebox.show("请选择类别!","提示",messageboxbuttons.ok,messageboxicon.Information) End If end if 明明cmb3中输入了内容,还是出现messagebox,哪里出了问题?
|
-- 作者:有点甜 -- 发布时间:2017/12/29 10:41:00 -- 没看懂你要做什么。其余代码删除,单独写
If e.form.controls("ComboBox3").text = nothing Then
messagebox.show("请选择类别!","提示",messageboxbuttons.ok,messageboxicon.Information)
End If
|
-- 作者:SZCD111 -- 发布时间:2017/12/29 11:20:00 -- ComboBox3是动态增加到窗口的。窗口保存数据之前,先判断窗口中是否存在ComboBox3,如果存在,如果没有输入数据,提示。 |
-- 作者:有点甜 -- 发布时间:2017/12/29 11:48:00 -- If e.Form.existcontrol("combobox3")=True Then
If e.form.controls("ComboBox3").text = nothing Then
end if messagebox.show("请选择类别!","提示",messageboxbuttons.ok,messageboxicon.Information)
End If |
-- 作者:SZCD111 -- 发布时间:2017/12/29 12:07:00 -- value不行吗? |
-- 作者:有点甜 -- 发布时间:2017/12/29 12:24:00 -- 你代码错误在于,你为什么又要重新CreateControl?
text,value都可以,但有微小区别
http://www.foxtable.com/webhelp/scr/0750.htm
|