Gets the row and column indexes of the cell at the specified pointer location.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As FpSpread
Dim rowViewportIndex As Integer
Dim columnViewportIndex As Integer
Dim x As Integer
Dim y As Integer
Dim value As CellRange
value = instance.GetCellFromPixel(rowViewportIndex, columnViewportIndex, x, y) |
Parameters
- rowViewportIndex
- Index of the row of the viewport
- columnViewportIndex
- Index of the column of the viewport
- x
- X-coordinate of the pointer location
- y
- Y-coordinate of the pointer location
Return Value
CellRange object containing the cell
Remarks
Example
This example gets the cell located at the specified pointer location.
C# | Copy Code |
---|
private void fpSpread1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
FarPoint.Win.Spread.Model.CellRange range = fpSpread2.GetCellFromPixel(0, 0, e.X, e.Y);
listBox1.Items.Add("range: row=" + range.Row.ToString() + " column=" + range.Column.ToString());
} |
Visual Basic | Copy Code |
---|
Private Sub FpSpread1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles FpSpread1.MouseDown
Dim range As FarPoint.Win.Spread.Model.CellRange = FpSpread2.GetCellFromPixel(0, 0, e.X, e.Y)
ListBox1.Items.Add("range: row=" & range.Row.ToString() & " column=" & range.Column.ToString())
End Sub |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also