以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 求助,这是咋回事?C1.Win.C1FlexGrid? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=133871) |
-- 作者:尘埃落定 -- 发布时间:2019/4/22 16:11:00 -- 求助,这是咋回事?C1.Win.C1FlexGrid? 如图所示 ![]() |
-- 作者:有点甜 -- 发布时间:2019/4/22 16:13:00 -- 请正确上传图片。
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=78
|
-- 作者:尘埃落定 -- 发布时间:2019/4/22 16:13:00 -- ![]() ![]() ![]() ![]() |
-- 作者:有点甜 -- 发布时间:2019/4/22 16:45:00 -- 全局代码改成,比如
Public Sub MouseLeaveCell(sender As object, e As C1.Win.C1FlexGrid.RowColEventArgs)
Public Sub MouseEnterCell(sender As object, e As C1.Win.C1FlexGrid.RowColEventArgs) |
-- 作者:尘埃落定 -- 发布时间:2019/4/22 17:44:00 -- 我的全局代码: Public flag As Boolean = True Public colName As String Public panel As Object Public filter As Object Public f_first As String Public f_other As String = "" Public Sub MouseEnterCell(sender As object, e As C1.Win.C1FlexGrid.RowColEventArgs) If e.Row = 0 Then colName = CurrentTable.Cols(e.Col-1).Name End If MyTimers("筛选").Enabled = True End Sub Public Sub MouseLeaveCell(sender As object, e As C1.Win.C1FlexGrid.RowColEventArgs) MyTimers("筛选").Enabled = False End Sub Public Sub selAll_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) For Each c As object In panel.controls c.Checked = sender.Checked Next End Sub Public Sub confirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim sels As String = "" For Each c As object In panel.controls If c.Checked Then sels += "\'" & c.Text & "\'," End If Next If colName = CurrentTable.Cols(0).Name Then f_first = colName & " In (" & sels.Trim(",") & ")" f_other = "" Else f_other = iif(f_other = "", "1=1", f_other) & " And " & colName & " In (" & sels.Trim(",") & ")" End If filter.close CurrentTable.Filter = iif(f_first = "", "1=1", f_first) & " And " & iif(f_other = "", "1=1", f_other) End Sub Public Sub cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) filter.close End Sub
|
-- 作者:尘埃落定 -- 发布时间:2019/4/22 17:45:00 -- 我的计划事件“筛选”代码如下 try filter = System.Windows.Forms.Form.ActiveForm If filter.Name = "FilterEditorForm" And flag Then flag = False MyTimers("筛选").Enabled = False filter.Controls.Clear filter.Padding = New System.Windows.Forms.Padding(8,0,8,8) Dim nc As Object nc = new system.windows.Forms.CheckBox nc.text = "全选" nc.backcolor = color.Transparent nc.width = 50 nc.left = 10 nc.Top = 10 AddHandler CType(nc, system.windows.Forms.CheckBox).CheckedChanged, AddressOf selAll_CheckedChanged filter.controls.add(nc) nc = new system.windows.Forms.button nc.text = "取消" nc.width = 60 nc.left = 200 nc.Top = 10 AddHandler CType(nc, system.windows.Forms.Button).Click, AddressOf cancel_Click filter.controls.add(nc) nc = new system.windows.Forms.button nc.text = "确定" nc.width = 60 nc.left = 265 nc.Top = 10 AddHandler CType(nc, system.windows.Forms.Button).Click, AddressOf confirm_Click filter.controls.add(nc) nc = new system.windows.Forms.panel nc.height = 140 nc.Dock = System.Windows.Forms.DockStyle.bottom nc.AutoScroll = True panel = nc filter.controls.add(nc) Dim count As Integer = 0 Dim ls As List(Of String) If colName = CurrentTable.Cols(0).Name Then ls = CurrentTable.DataTable.GetUniqueValues("", colName) Else ls = CurrentTable.DataTable.GetUniqueValues(CurrentTable.Filter, colName) End If For Each data As String In ls Dim cbx = new system.windows.Forms.CheckBox cbx.text = data cbx.height = 18 cbx.Top = count * 20 count += 1 cbx.Font = New Font("楷书", 9, FontStyle.Bold) cbx.backcolor = color.Transparent nc.controls.add(cbx) Next flag = True End If catch ex As exception \'出错不执行任何代码. End try
|
-- 作者:有点甜 -- 发布时间:2019/4/22 17:45:00 -- 把bin文件夹删除,重新打开项目测试。
如果还报错,实例发上来测试。 |
-- 作者:尘埃落定 -- 发布时间:2019/4/22 17:46:00 -- 但还是出现上述图片中的提示,请教老师帮忙解决 |
-- 作者:有点甜 -- 发布时间:2019/4/22 17:48:00 -- 以下是引用尘埃落定在2019/4/22 17:46:00的发言:
但还是出现上述图片中的提示,请教老师帮忙解决
不可能,上传实例测试。 |
-- 作者:尘埃落定 -- 发布时间:2019/4/23 17:19:00 -- 有点甜老师,我找到原因了,不能再全局表的MouseEnterCell和MouseLeaveCell中有代码,如果有代码,就会出现上述图片。 |