65.9K
CodeProject is changing. Read more.
Home

Determine the Row and Column of a View

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.89/5 (3 votes)

Dec 17, 1999

viewsIcon

68273

A function that tells you where on a split window a view is located

This method will tell you where on the split window this view is located (row and column).

void CMySplitterView::GetRowCol(int &row, int &col) 
{
	CSplitterWnd * parent;
	parent = (CSplitterWnd*)GetParent();
	int rows = parent->GetRowCount();
	int cols = parent->GetColumnCount();
	for (row = 0; row < rows; row++)
	{
		for (col = 0; col < cols; col++)
		{
			if (this == parent->GetPane(row,col))
			{
				return;
			}
		}
	}
	ASSERT(FALSE);
}

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.

A list of licenses authors might use can be found here.