Solved

Change Focus in a PropertySheet.

Posted on 1998-11-15
9
190 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 100 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use of condition with 'serial' in ansible 2 88
changeXy challenge 13 94
mapAB Challlenge 35 174
how to split multiple lines delimiter : 8 120
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 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