Spread Windows Forms 6.0 Product Documentation
GetCellFromPixel(Int32,Int32) Method
See Also  Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SpreadView Class > GetCellFromPixel Method : GetCellFromPixel(Int32,Int32) Method


x
X-coordinate (in pixels) of the pointer location
y
Y-coordinate (in pixels) of the pointer location

Glossary Item Box

Gets the row and column indexes of the cell at the specified pointer location.

Syntax

Visual Basic (Declaration) 
Public Overloads Function GetCellFromPixel( _
   ByVal x As Integer, _
   ByVal y As Integer _
) As CellRange
Visual Basic (Usage)Copy Code
Dim instance As SpreadView
Dim x As Integer
Dim y As Integer
Dim value As CellRange
 
value = instance.GetCellFromPixel(x, y)
C# 
public CellRange GetCellFromPixel( 
   int x,
   int y
)

Parameters

x
X-coordinate (in pixels) of the pointer location
y
Y-coordinate (in pixels) of the pointer location

Return Value

CellRange object containing the row and column indexes (in a ) for the cell located at the specified pointer location, or (-1,-1,-1,-1) if no cell is located at the specified location

Remarks

This method returns a CellRange object that consists of row and column coordinates and row and column counts. If a cell exists at the pixel location, then the method returns CellRange(row, column, 1, 1) where row, column are the row index and column index of the cell. If a cell does not exist at the pixel location then the method returns CellRange(-1,-1,-1,-1).

Use the x and y parameters to specify the location (pixel) on the display of the pointer (or cursor).

This method only returns cell information for pixel locations in the data area of the sheet, and not for headers or sheet corner or other parts of the Spread component. For cells in the column headers and row headers, use the GetColumnHeaderCellFromPixel and GetRowHeaderCellFromPixel methods.

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

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.