Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Resize CPropertySheet

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
gsteup
Asked:
gsteup
  • 3
  • 2
1 Solution
 
jcgdCommented:
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
 
gsteupAuthor Commented:
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
 
gsteupAuthor Commented:
Sorry, the header is of course:

void Sheet::moveTabs(DWORD x,DWORD y,DWORD cx,DWORD cy)
0
 
jcgdCommented:
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
 
gsteupAuthor Commented:
Thanks for all the help!!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now