ZForge.Controls.TreeViewAdv.Tree.AutoRowHeightLayout.GetRowAt C# (CSharp) Method

GetRowAt() public method

public GetRowAt ( Point point ) : int
point Point
return int
        public int GetRowAt(Point point)
        {
            int py = point.Y - _treeView.ColumnHeaderHeight;
            int y = 0;
            for (int i = _treeView.FirstVisibleRow; i < _treeView.RowCount; i++)
            {
                int h = GetRowHeight(i);
                if (py >= y && py < y + h)
                    return i;
                else
                    y += h;
            }
            return -1;
        }