老师你好,我新建了一个窗口forms(“饲料消耗-查找”),button(“确定”),button(“消除”)还有其他的combobox控件
forms(“饲料消耗-查找”)的afterload事件为:
Dim ksrq As WinForm.DateTimePicker = e.Form.Controls("开始日期")
Dim jsrq As WinForm.DateTimePicker = e.Form.Controls("结束日期")
Dim ds As WinForm.ComboBox = e.Form.Controls("栋舍")
Dim zzlx As WinForm.ComboBox = e.Form.Controls("猪只类型")
Dim slzl As WinForm.ComboBox = e.Form.Controls("饲料种类")
Dim sllx As WinForm.ComboBox = e.Form.Controls("饲料类型")
Dim slpp As WinForm.ComboBox = e.Form.Controls("饲料品牌")
ds.ComboList = DataTables("猪舍设置").GetComboListString("栋舍名称")
zzlx.ComboList = DataTables("猪只类型").GetComboListString("类型名称")
slzl.ComboList = DataTables("饲料种类").GetComboListString("饲料种类")
sllx.ComboList = DataTables("饲料类型").GetComboListString("饲料类型")
slpp.ComboList = DataTables("饲料供应商信息").GetComboListString("公司品牌")
button(“确定”)的click事件:
Dim jsrq As WinForm.DateTimePicker = e.Form.Controls("结束日期")
Dim ksrq As WinForm.DateTimePicker = e.Form.Controls("开始日期")
Dim ds As WinForm.ComboBox = e.Form.Controls("栋舍")
Dim zzlx As WinForm.ComboBox = e.Form.Controls("猪只类型")
Dim slzl As WinForm.ComboBox = e.Form.Controls("饲料种类")
Dim sllx As WinForm.ComboBox = e.Form.Controls("饲料类型")
Dim slpp As WinForm.ComboBox = e.Form.Controls("饲料品牌")
Dim jsrq1 As Date = jsrq.Value
Dim ksrq1 As Date = ksrq.Value
Dim ds1 As String = ds.Value
Dim zzlx1 As String = zzlx.Value
Dim slzl1 As String = slzl.Value
Dim sllx1 As String = sllx.Value
Dim slpp1 As String = slpp.Value
Dim f As String = "[日期] >= '" & ksrq1 & "' and [日期]< ='" & jsrq1 & "' and [sys_user] = '" & user.Name & "' and [栋舍] ='" & ds1 & "' and [猪只类型] ='" & zzlx1 & "' and [饲料_种类] ='" & slzl1 & "' and [饲料_类型] ='" & sllx1 & "' and [饲料_品牌] ='" & slpp1 & "' "
DataTables("饲料消耗").LoadOrder = "日期"
DataTables("饲料消耗").LoadTop = "14"
DataTables("饲料消耗").LoadPage = "0"
DataTables("饲料消耗").LoadFilter = f
DataTables("饲料消耗").load()
Dim ys As WinForm.Label = Forms("饲料消耗").Controls("页数")
Dim ys1 As WinForm.Label = Forms("饲料消耗").Controls("页数1")
Dim a As Integer = DataTables("饲料消耗").TotalPages
If a > 0 Then
ys1.Text = "第" & "1" & "页"
ys.Text = "共" & a & "页" & ","
Else
ys1.Text = "第" & "0" & "页"
ys.Text = "共" & "0" & "页" & ","
End If
button(“消除”)的click事件:
Dim jsrq As WinForm.DateTimePicker = e.Form.Controls("结束日期")
Dim ksrq As WinForm.DateTimePicker = e.Form.Controls("开始日期")
Dim ds As WinForm.ComboBox = e.Form.Controls("栋舍")
Dim zzlx As WinForm.ComboBox = e.Form.Controls("猪只类型")
Dim slzl As WinForm.ComboBox = e.Form.Controls("饲料种类")
Dim sllx As WinForm.ComboBox = e.Form.Controls("饲料类型")
Dim slpp As WinForm.ComboBox = e.Form.Controls("饲料品牌")
jsrq.Value = Nothing
ksrq.Value = Nothing
ds.Value = Nothing
zzlx.Value = Nothing
slzl.Value = Nothing
sllx.Value = Nothing
slpp.Value = Nothing
打开窗口,点击了以下button(“消除”),后以下控件变成暗灰色,不能再筛选,老师怎么解决?
e.Form.Controls("开始日期")
e.Form.Controls("结束日期")
e.Form.Controls("栋舍")
e.Form.Controls("猪只类型")
e.Form.Controls("饲料种类")
e.Form.Controls("饲料类型")
e.Form.Controls("饲料品牌")