Click here to Skip to main content
15,886,771 members
Articles / Mobile Apps / Windows Mobile

Determine the Row and Column of a View

Rate me:
Please Sign up or sign in to vote.
1.89/5 (3 votes)
16 Dec 1999 68K   18   3
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).

C++
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.


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralEasier way Pin
Greg Marr25-Jan-00 5:01
Greg Marr25-Jan-00 5:01 
GeneralRe: Easier way Pin
Anonymous8-Aug-05 1:02
Anonymous8-Aug-05 1:02 
GeneralRe: Easier way Pin
Anonymous8-Aug-05 1:10
Anonymous8-Aug-05 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.