Solved

Change Focus in a PropertySheet.

Posted on 1998-11-15
9
192 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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
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

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

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…
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…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

632 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