在用下面的代码取鼠标点击的列表头的坐标时发现,列表头的左上角的第一列取到的坐标是(0,0)没问题,但是当点击表格左上角的角标位置时,取到的坐标也是(0,0),这就导致点击角标时也会触发点击第一列头的效果。请问能区分出来点击的是第一列还是角标吗?
Private Sub FpSpread1_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles FpSpread1.MouseDown
If (e.Button = System.Windows.Forms.MouseButtons.Left) Then
Dim ht As FarPoint.Win.Spread.HitTestInformation = Me.FpSpread1.HitTest(e.X, e.Y)
If Not ht.HeaderInfo Is Nothing Then
If ht.HeaderInfo.Column = 0 AndAlso ht.HeaderInfo.Row = 0 Then
Me.FpSpread1.ActiveSheet.ColumnHeader.Columns(0).Locked = True
End If
End If
End If
End Sub |
|