Solved

Change Focus in a PropertySheet.

Posted on 1998-11-15
9
185 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
  • 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now