MSHFlexgrid中如何使定位行反色

最好的方法:

首先
你得把MSHFlexgrid的
BackColorSel
ForeColorSel
两个属性设为不同的颜色值

然后在MSHFlexgrid的MouseDown中加入:

Private Sub MSHFlexgrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
With MSHFlexgrid1
.Row = .MouseRow
If .Row <> 0 Then
.Col = .Cols - 1
.ColSel = 1
End If
End With
End Sub

也看过有人用过此方法,但有一点很不好,就是他们把

.Col = .Cols - 1
.ColSel = 1

写成了

.Col=0
.ColSel=.Cols-1

这样的话用户点击MSHFlexgrid时,MSHFlexgrid会移到
最后一列去,如何你的列多得一屏无法显示的话,那么
你会看到很糟糕的现象。

这样给用户的印象很不好,用户会感到恐慌。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus