以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]对第一个显示列DrawCell着色,应该怎么办  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=47348)

--  作者:jnletao
--  发布时间:2014/3/8 17:30:00
--  [求助]对第一个显示列DrawCell着色,应该怎么办
对第一个显示列DrawCell着色,应该怎么办 ?

就是我的列显示隐藏是让用户控制的, 可是有个着色,想着让它始终对第一列着色!

--  作者:狐狸爸爸
--  发布时间:2014/3/8 17:31:00
--  

为了提高效率,可以用一个全局变量,将第一个显示列保存在这个全局变量中。

 

 


--  作者:jnletao
--  发布时间:2014/3/8 17:36:00
--  
可我的显示隐藏 用是的是 系统命令,Syscmd.Row.ShowHideRows(),而且列位置是可以拖动的,该如何 获取 第一个显示列?
--  作者:ericsky
--  发布时间:2014/3/8 17:41:00
--  
遍历列,判断是否可见,试试看可不可以


--  作者:狐狸爸爸
--  发布时间:2014/3/8 17:42:00
--  

for i as integer = 0 tables("xxx").cols

    if tables("xxx").cols(i).Visible then

        MessaGEBOX.SHOW("第一个显示列是:"& tables("xxx").cols(i))

    end if

next


--  作者:jnletao
--  发布时间:2014/3/8 17:44:00
--  
那如何监测   Syscmd.Row.ShowHideRows() 事件
--  作者:lsy
--  发布时间:2014/3/8 17:56:00
--  
DataTables("表A").AddUserStyle("a", Color.Red, Color.White)
If e.Col.Index = 0 Then
    e.Style = "a"
End If

--  作者:jnletao
--  发布时间:2014/3/8 18:03:00
--  

DrawCell  ‘RowColorShow 着色开关,MaxProcessNum,最终进度


If RowColorShow Then  

    If e.Col.Index = 0  AndAlso e.Row.IsNull("流程进度") = False Then

        e.StartDraw()

        Dim Width As Integer = (e.Width - 2 ) * e.Row("流程进度") \\ MaxProcessNum

        e.Graphics.FillRectangle(Brushes.SkyBlue,e.x + 1,e.y + 1, Width, e.Height - 2)

        e.EndDraw()

    End If

End If


If e.Col.Index = 0 ,切换显示隐藏后不行

[此贴子已经被作者于2014-3-8 18:04:31编辑过]

--  作者:逛逛
--  发布时间:2014/3/8 18:17:00
--  

 

1、遍历列,找到第一个可视列,获取列名

 

后面只要判断一下是单元格是否是这一列的就行了


--  作者:lsy
--  发布时间:2014/3/8 18:24:00
--  
DataTables("表A").AddUserStyle("a", Color.Red, Color.White)
Dim lst As New List(Of Integer)
For i As Integer = 0 To e.Table.Cols.Count - 1
    If e.Table.Cols(i).Visible = True AndAlso lst.Contains(i) = False Then
        lst.Add(i)
    End If
Next
Dim str() As Integer = lst.ToArray
Array.Sort(str)
If e.Col.Index = str(0) Then
    e.Style = "a"
End If