Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change Focus in a PropertySheet.

Posted on 1998-11-15
9
Medium Priority
?
193 Views
Last Modified: 2013-11-20
I´ve made a CDialog based app where I have a PropertySheet om the main dialog. I have made 2 sheets and when I want to check the variables on both pages I run in to trouble. I can check the top sheet by calling.
No1.UpdateData(TRUE);
But if I do the same on No2 the prog crashes. How do I change the focus on the sheets so I also can use UpdateData on the 2:d sheet.
Thanx....
0
Comment
Question by:Ffaze
[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
  • 6
  • 3
9 Comments
 

Author Comment

by:Ffaze
ID: 1324723
Adjusted points to 100
0
 

Author Comment

by:Ffaze
ID: 1324724
Edited text of question
0
 
LVL 1

Expert Comment

by:atari
ID: 1324725
Where is the problem, if you call UpdateData() from your sheet, then you can Update all CPropertyPages:

Define two variables in your sheet.h-file:

CPropertyPage m_Page1;
CPropertyPage m_Page2;

and then in your sheet.cpp-file you can call:
m_Page1.UpdateData(TRUE);
m_Page2.UpdateData(FALSE);

and so on.

If you want to update page2 from page1 then it is a little bit complicated:

CPropertySheet *PointerAufPropertySheet=(CPropertySheet *)GetParent();
((CYourDialog *)PointerAufPropertySheet->GetParent())->DoWhatYouWant();

with proper casting the GetParent()-function you can reach every parent-class you wish.

Hope this helps,
atari
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 1

Expert Comment

by:atari
ID: 1324726
If you are still in trouble with your code then send me your small dialog as .zip-file to mkuelsh@aol.com and I try to fix your error !! Because I have done the stuff with property sheets and pages a lot.

Bye,
atari
0
 

Author Comment

by:Ffaze
ID: 1324727
This is how I show the Sheet.
      PropertySheet.AddPage(&StartMenuDlg);
      PropertySheet.AddPage(&DesktopDlg);
If I make like you said the prog crashes. Don´t I have to make m_Page1 and m_Page2 point to the right sheets. How do I do that??

0
 

Author Comment

by:Ffaze
ID: 1324728
I unlock this question for more Ideas....
0
 

Author Comment

by:Ffaze
ID: 1324729
I unlock this question for more Ideas....
If nobody else help me out atari gets the points....
But since the answer didn´t work I want a simple answer as soon as possible....
Thanx
0
 
LVL 1

Accepted Solution

by:
atari earned 300 total points
ID: 1324730
Next try:
I have too small information for solving your problem, try this:

if (m_YourSheet.GetActiveIndex()==0)
    m_Page1.UpdateData(FALSE);;
if (m_YourSheet.GetActiveIndex()==1)
    m_Page2.UpdateData(FALSE);

With calls of m_YourSheet.SetActiveIndex() you can also set one of the property pages active which you wish.

Maybe this works, I have too small information what you are exactly do !!!

Bye,
atari
0
 

Author Comment

by:Ffaze
ID: 1324731
It worked thanks for all your work.....
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 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