/// <summary> /// Perform a HitTest for the header control /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns>Null if the given point isn't over the header</returns> internal OlvListViewHitTestInfo.HeaderHitTestInfo HitTest(int x, int y) { Rectangle r = ClientRectangle; if (!r.Contains(x, y)) { return(null); } Point pt = new Point(x + ListView.LowLevelScrollPosition.X, y); OlvListViewHitTestInfo.HeaderHitTestInfo hti = new OlvListViewHitTestInfo.HeaderHitTestInfo(); hti.ColumnIndex = NativeMethods.GetColumnUnderPoint(Handle, pt); hti.IsOverCheckBox = IsPointOverHeaderCheckBox(hti.ColumnIndex, pt); hti.OverDividerIndex = NativeMethods.GetDividerUnderPoint(Handle, pt); return(hti); }
/// <summary> /// Perform a HitTest for the header control /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns>Null if the given point isn't over the header</returns> internal OlvListViewHitTestInfo.HeaderHitTestInfo HitTest(int x, int y) { Rectangle r = this.ClientRectangle; if (!r.Contains(x, y)) return null; Point pt = new Point(x + this.ListView.LowLevelScrollPosition.X, y); OlvListViewHitTestInfo.HeaderHitTestInfo hti = new OlvListViewHitTestInfo.HeaderHitTestInfo(); hti.ColumnIndex = NativeMethods.GetColumnUnderPoint(this.Handle, pt); hti.IsOverCheckBox = this.IsPointOverHeaderCheckBox(hti.ColumnIndex, pt); hti.OverDividerIndex = NativeMethods.GetDividerUnderPoint(this.Handle, pt); return hti; }