?
Solved

Resize CPropertySheet

Posted on 2003-03-21
5
Medium Priority
?
387 Views
Last Modified: 2013-11-20
I "have" (=need to create) an app that is basically a PropertySheet with several tabs. The PropertySheet is supposed to only take about the lower 2/3 of the window and leave the upper room for some global controls (a button, a listbox and several static texts). No extra space on the sides is necessary.

Also I do not need the "OK" and "Cancel" button that come with DoModal.

Am I on the right track with using CPropertySheet and if yes how could I accomplish the above? If not what would be a better way?
0
Comment
Question by:gsteup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
jcgd earned 400 total points
ID: 8183414
in OnInitialUpdate (for VIEW) or OnInitDialog (for Dialog)

   m_pSheet = new CPropertySheet;
   m_pPage1 = new CMyPage1;
   m_pPage2 = new CMyPage2;
   m_pPage3= new CMyPage3;


   m_pSheet->AddPage(m_pPage1);
   m_pSheet->AddPage(m_pPage2);
   m_pSheet->AddPage(m_pPage3);

   m_pSheet->Create(this, WS_CHILD | WS_VISIBLE | WS_TABSTOP, WS_EX_CONTROLPARENT);
     
   m_pSheet->SetActivePage(2);
   m_pSheet->SetActivePage(1);
   m_pSheet->SetActivePage(0);
     m_pSheet->SetWindowPos(NULL, nLeft,nTop,nWidth,nHeight,SWP_NOSIZE | SWP_NOZORDER |  SWP_NOACTIVATE);

   CRect rcSheet;
   GetClientRect(&rcSheet);
     m_Page1->SetWindowPos(NULL,nLeft,nTop,nWidth ,nHeight ,SWP_NOSIZE | SWP_NOZORDER |  SWP_NOACTIVATE);
     m_Page2->SetWindowPos(NULL,nLeft,nTop,nWidth ,nHeight ,SWP_NOSIZE | SWP_NOZORDER |  SWP_NOACTIVATE);
     m_Page3->SetWindowPos(NULL,nLeft,nTop,nWidth ,nHeight ,SWP_NOSIZE | SWP_NOZORDER |  SWP_NOACTIVATE);
0
 
LVL 2

Author Comment

by:gsteup
ID: 8194476
Thanks for help so far.
I only have one more problem:
When I resize the Sheet nothing happens. When I resize the Tab the sheet gets clipped.

I embedded the tabs inside the Sheet class and created a member function that is supposed to resize the Tabs and the Sheet:

void Sheet::moveTabs(DWORD x,DWORD x,DWORD x,DWORD cy)
{

  tab1.SetWindowPos(NULL,x,y,cx,cy, SWP_NOZORDER |  SWP_NOACTIVATE);
  this.SetWindowPos(NULL,x,y,cx,cy, SWP_NOZORDER | SWP_NOACTIVATE);
}

What am I doing wrong?
0
 
LVL 2

Author Comment

by:gsteup
ID: 8194480
Sorry, the header is of course:

void Sheet::moveTabs(DWORD x,DWORD y,DWORD cx,DWORD cy)
0
 
LVL 3

Expert Comment

by:jcgd
ID: 8196590
Change:
this.SetWindowPos(NULL,x,y,cx,cy, SWP_NOZORDER | SWP_NOACTIVATE);

to

GetTabControl()->SetWindowPos(NULL,x,y,cx,cy, SWP_NOZORDER | SWP_NOACTIVATE);

0
 
LVL 2

Author Comment

by:gsteup
ID: 8197177
Thanks for all the help!!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question