Spread Windows Forms 6.0 Product Documentation
InShape Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ViewportHitTestInformation Class : InShape Property


Glossary Item Box

Gets whether the location refers to a shape.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property InShape As Boolean
Visual Basic (Usage)Copy Code
Dim instance As ViewportHitTestInformation
Dim value As Boolean
 
value = instance.InShape
C# 
public bool InShape {get;}

Property Value

Boolean: true if the cursor is over the shape; false otherwise

Example

This example returns whether the cursor is on the shape.
C#Copy Code
private void fpSpread1CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
{
      FarPoint.Win.Spread.HitTestInformation hti;
      FarPoint.Win.Spread.ViewportHitTestInformation vi;
      hti = fpSpread1.HitTest(e.X, e.Y);
      vi = hti.ViewportInfo;
      if (hti.Type == HitTestType.Viewport)
      {
            MessageBox.Show(vi.InShape.ToString());
      }   
}
Visual BasicCopy Code
Private Sub FpSpread1CellClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs)
      Dim hti As FarPoint.Win.Spread.HitTestInformation
      Dim vi As New FarPoint.Win.Spread.ViewportHitTestInformation
      hti = FpSpread1.HitTest(e.X, e.Y)
      vi = hti.ViewportInfo
      If hti.Type = HitTestType.Viewport Then
            MessageBox.Show(vi.InShape)
      End If
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

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