Working with Property Pages and Property Sheets... 
Author Message
 Working with Property Pages and Property Sheets...

I'm having a problem where I have a button on a Property Page, and when it
is done processing, I need it to activate another property page (tab) of the
property sheet.  What code can I put in to do this?  I was playing around
with the SetActivePage member function, but that is a member of the
CPropertySheet class, and when I need to call it, I am in a CPropertyPage
object.  Is there a simple way to make the property sheet object global so
that I can access it in my property page object.  Thanks for the help

Dave



Sun, 11 Jun 2000 03:00:00 GMT  
 Working with Property Pages and Property Sheets...

Quote:

> I'm having a problem where I have a button on a Property Page, and when it
> is done processing, I need it to activate another property page (tab) of the
> property sheet.  What code can I put in to do this?  I was playing around
> with the SetActivePage member function, but that is a member of the
> CPropertySheet class, and when I need to call it, I am in a CPropertyPage
> object.  Is there a simple way to make the property sheet object global so
> that I can access it in my property page object.  Thanks for the help

> Dave

((CPropertySheet*)GetParentOwner())->SetActivePage(x);

        Rail
--
        Recording Engineer/Software Developer
        Rail Jon Rogut Software
        http://home.earthlink.net/~railro



Sun, 11 Jun 2000 03:00:00 GMT  
 Working with Property Pages and Property Sheets...

Quote:

> I'm having a problem where I have a button on a Property Page, and when it
> is done processing, I need it to activate another property page (tab) of the
> property sheet.  What code can I put in to do this?  I was playing around
> with the SetActivePage member function, but that is a member of the
> CPropertySheet class, and when I need to call it, I am in a CPropertyPage
> object.  Is there a simple way to make the property sheet object global so
> that I can access it in my property page object.  Thanks for the help

I usually store a pointer to my CPropertySheet in every CPropertyPage it
contains.

Sebastian

Quote:

> Dave



Tue, 13 Jun 2000 03:00:00 GMT  
 Working with Property Pages and Property Sheets...

Quote:
>I was playing around
>with the SetActivePage member function, but that is a member of the
>CPropertySheet class, and when I need to call it, I am in a CPropertyPage
>object.

Dave,

The property sheet is the parent of the property pages, so from any
CPropertyPage member function you can call GetParent to get a pointer
to the property sheet:

CMyPropPage::Function()
{
        CPropertySheet * pS = (CPropertySheet *) GetParent();
        ...

Quote:
}

Dave Lowndes
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.


Thu, 15 Jun 2000 03:00:00 GMT  
 Working with Property Pages and Property Sheets...

Quote:

> >I was playing around
> >with the SetActivePage member function, but that is a member of the
> >CPropertySheet class, and when I need to call it, I am in a CPropertyPage
> >object.

> Dave,

> The property sheet is the parent of the property pages, so from any
> CPropertyPage member function you can call GetParent to get a pointer
> to the property sheet:

> CMyPropPage::Function()
> {
>         CPropertySheet * pS = (CPropertySheet *) GetParent();
>         ...

> }

> Dave Lowndes
> ----
> Address is altered to discourage junk mail.
> Remove ".---" for the real address.

That's not a good idea.  From the help file: "The returned pointer may
be temporary and should not be stored for later use."

Which means that you should not save the value and use it as you
describe, you can probably get away with:

        CPropertySheet * pS = (CPropertySheet *) GetParent();
        pS->SetActivePage(0);

ie. use it immediately after you assign the value, but the best method
is to use:

        (CPropertySheet *) GetParent()->SetActivePage(0);

All the best for a Happy '98

        Rail
--
        Recording Engineer/Software Developer
        Rail Jon Rogut Software
        http://home.earthlink.net/~railro



Fri, 16 Jun 2000 03:00:00 GMT  
 Working with Property Pages and Property Sheets...

Quote:
>That's not a good idea.  From the help file: "The returned pointer may
>be temporary and should not be stored for later use."

Rail,

I think you're taking that slightly out of context. The temporary
object cleanup only happens during idle time processing, so in the
context of processing a single message it's perfectly safe. In respect
to what we're discussing here, it's worked fine for me whenever I've
used it.

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.



Sun, 18 Jun 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Property Sheet and Property pages in ATL

2. How to disable property page on property sheet.

3. Property sheet in a property page

4. Property pages disappearing from property sheet on selection

5. questions regarding property sheet and property page

6. Problem with same property page in multiple property sheets

7. Sizing Property Sheets/Property Pages

8. Problems with property sheets and property pages

9. Property Sheet and Property Pages

10. Property Sheet on Property Page?

11. resizable property sheet and property page

12. Q: Set Tab Window Text in Property Page/Property Sheet

 

 
Powered by phpBB® Forum Software