GrapeCity MultiRow Windows Forms Documentation
HitTestInfo Class
Members  Example 


Contains information about part of the GcMultiRow control at a specified coordinate. This class cannot be inherited.
Syntax
Public NotInheritable Class HitTestInfo 
Dim instance As HitTestInfo
public sealed class HitTestInfo 
Remarks
You can use the GcMultiRow's GcMultiRow.HitTest method to hit test the location.
Example
The following code example shows how to use GcMultiRow's hit test. If you use the right mouse button to click the ColumnHeaderSection, the clicked cell executes an automatic resize.
class HitTestDemo : Form
    {
        private GcMultiRow gcMultiRow1 = new GcMultiRow();
        private FlowLayoutPanel panel = new FlowLayoutPanel();
        private Label label = new Label();

        public HitTestDemo()
        {
            this.Text = "HitTest Demo";
            this.Size = new Size(700, 250);

            // Add MultiRow to Form
            this.gcMultiRow1.Dock = DockStyle.Fill;
            this.Controls.Add(this.gcMultiRow1);

            label.Height = 50;
            label.Dock = DockStyle.Bottom;
            label.BackColor = SystemColors.Info;
            label.Text = "Right Click the ColumnHeader, the clicked cell will be auto fitted.";
            this.Controls.Add(label);

            this.Load += new EventHandler(Form1_Load);

            this.StartPosition = FormStartPosition.CenterScreen;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            gcMultiRow1.Template = Template.CreateGridTemplate(10);
            gcMultiRow1.RowCount = 5;
            gcMultiRow1.MouseClick += new MouseEventHandler(gcMultiRow1_MouseClick);
        }
Class HitTestDemo
    Inherits Form
    Friend WithEvents gcMultiRow1 As New GcMultiRow()
    Private panel As New FlowLayoutPanel()
    Private label As New Label()

    Public Sub New()
        Me.Text = "HitTest Demo"
        Me.Size = New Size(700, 250)

        ' Add MultiRow to Form
        Me.gcMultiRow1.Dock = DockStyle.Fill
        Me.Controls.Add(Me.gcMultiRow1)

        label.Height = 50
        label.Dock = DockStyle.Bottom
        label.BackColor = SystemColors.Info
        label.Text = "Right Click the ColumnHeader, the clicked cell will be auto fitted."
        Me.Controls.Add(label)

        Me.StartPosition = FormStartPosition.CenterScreen
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        gcMultiRow1.Template = Template.CreateGridTemplate(10)
        gcMultiRow1.RowCount = 5
    End Sub
Inheritance Hierarchy

System.Object
   GrapeCity.Win.MultiRow.HitTestInfo

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

Reference

HitTestInfo Members
GrapeCity.Win.MultiRow Namespace
HitTest(Int32,Int32) Method

 

 


Copyright © GrapeCity, inc. All rights reserved.