CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2009
    Posts
    103

    Convert existing dialogs/tabctrl to propertypages/sheet?

    First off I want to thank all who have been giving me good suggestions, tips and examples on here with my current issues involving tabctrl. It has been recommeded by several that I switch to propertpages instead and after researching it, I can see why.

    As mentioned in other posts, I am experienced with C++ application programming but not the upper "end" aspects of it and examples often help clarify things when ever possible.

    Now this may be a "simple" thing to many but for a novice with this... it is a bit confusing.



    As mentioned before, I currently have a main dialog that currently holds the CTabctrl. Will call in AcctMain. I also have several dialogs, already created and coded with fields, etc that are the actual tab pages themselves. They are AcctSetup, AcctDetail, AcctStatus. All was created using the Resource Editor and inserting Dialogs as needed. The AcctMain as well as the class for the CTabctrl had the code that actually associated each tab with the appropriate dialog.

    Is there an easy way to convert all this (or some of it) to a propertysheet and propertypages without having to recreate and recode all this existing work? It looks similar in alot of aspects but then the MFC examples I have run across have different ways to create it.

    Once again, thanks for any direction you can provide....

  2. #2
    Join Date
    Feb 2009
    Location
    India
    Posts
    444

    Re: Convert existing dialogs/tabctrl to propertypages/sheet?

    Change the base class for the classes AcctSetup, AcctDetail, AcctStatus from CDialog to CPropertyPage. You could do a find and replace here.
    Then create a CPropertySheet object and call its AddPage method for each of your 3 dialogs.
    Then call DoModal on your property sheet object.
    «_Superman
    I love work. It gives me something to do between weekends.

    Microsoft MVP (Visual C++)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured