以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]有没有单击表头的事件? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188274) |
-- 作者:moseser -- 发布时间:2023/9/11 16:25:00 -- [求助]有没有单击表头的事件? 如题 |
-- 作者:有点蓝 -- 发布时间:2023/9/11 16:40:00 -- 没有的。全部表事件都在这了:http://www.foxtable.com/webhelp/topics/1446.htm |
-- 作者:moseser -- 发布时间:2023/9/12 14:37:00 -- 回复:(有点蓝)没有的。全部表事件都在这了:http:/... 这是是双击的,是否可以修改下做成单击的 AfterOpenProject
For Each t As Table In Tables t.grid.Name = t.Name addhandler t.grid.MouseEnterCell, addressof MouseEnterCellHandler addhandler t.grid.MouseLeaveCell, addressof MouseLeaveCellHandler addhandler t.grid.DoubleClick, addressof DoubleClickHandler addhandler t.grid.click, addressof ClickHandler Next 全局代码
Default
Public headCol As Integer = -1
Public Sub MouseLeaveCellHandler(sender As object, e As C1.Win.C1FlexGrid.RowColEventArgs ) headcol = -1 End Sub
Public Sub MouseEnterCellHandler(sender As object, e As C1.Win.C1FlexGrid.RowColEventArgs ) If e.Row = 0 Then headcol = e.Col End If End Sub
Public Sub DoubleClickHandler(sender As object, e As System.EventArgs) If headcol <> -1 Then Dim str As String try cursor.tostring str = "正常" catch ex As exception str = "特殊" End try msgbox(str) End If End Sub Public cursor Public Sub ClickHandler(ByVal sender As System.Object, ByVal e As System.EventArgs) cursor = System.Windows.Forms.Cursor.Current End Sub |
-- 作者:有点蓝 -- 发布时间:2023/9/12 15:04:00 -- 这个就是单击的:addhandler t.grid.click, addressof ClickHandler |