-
September 10th, 2010, 03:16 PM
#1
Function to Draw Controls from a different dialog box template
I have a section in a FormView in which I draw different groups of controls depending on the situation. I have to programaticlly adjust each control
I was thinking of leveraging the resource graphical editor to position the controls.
I need a function that would take a dialog template file and just draw the controls. I will add the programing code manually.
Any suggestions?
Rate this post if it helped you.
-
September 10th, 2010, 07:17 PM
#2
Re: Function to Draw Controls from a different dialog box template
How many different groups of controls do you have?
-
September 10th, 2010, 07:59 PM
#3
Re: Function to Draw Controls from a different dialog box template
Rate this post if it helped you.
-
September 10th, 2010, 08:27 PM
#4
Re: Function to Draw Controls from a different dialog box template
Use a property sheet control set to wizard mode.
Set the property sheet to a child style and make it a child of your dialog. Create a CPropertyPage for each group of controls, when you need to change groups, just set the active page in the property sheet.
The advantage with this approach is you can use the dialog editor to lay out the groups of controls.
-
September 10th, 2010, 11:41 PM
#5
Re: Function to Draw Controls from a different dialog box template
Originally Posted by Arjay
Use a property sheet control set to wizard mode.
Set the property sheet to a child style and make it a child of your dialog. Create a CPropertyPage for each group of controls, when you need to change groups, just set the active page in the property sheet.
The advantage with this approach is you can use the dialog editor to lay out the groups of controls.
Don't I want to use a TabCtrl??
Rate this post if it helped you.
-
September 10th, 2010, 11:51 PM
#6
Re: Function to Draw Controls from a different dialog box template
Originally Posted by ADSOFT
Don't I want to use a TabCtrl??
If you want to do it the hard way, then sure.
-
September 11th, 2010, 07:52 AM
#7
Re: Function to Draw Controls from a different dialog box template
Originally Posted by ADSOFT
Don't I want to use a TabCtrl??
You know better what you want.
Well, for the actual problem, the Arjay's solution is better...
-
September 11th, 2010, 01:59 PM
#8
Re: Function to Draw Controls from a different dialog box template
-
September 12th, 2010, 09:39 AM
#9
Re: Function to Draw Controls from a different dialog box template
Yep I'm using MFC.
btw, do you have an example of what you are talking about. I couldn't find anything on property sheet wizards ..... etc.
Rate this post if it helped you.
-
September 12th, 2010, 12:20 PM
#10
Re: Function to Draw Controls from a different dialog box template
Originally Posted by ADSOFT
Yep I'm using MFC.
btw, do you have an example of what you are talking about. I couldn't find anything on property sheet wizards ..... etc.
Help me understand here - I'm confused that you can't find anything. What search terms are you trying in google and msdn?
-
September 13th, 2010, 02:02 AM
#11
Re: Function to Draw Controls from a different dialog box template
Originally Posted by Arjay
Help me understand here - I'm confused that you can't find anything. What search terms are you trying in google and msdn?
Ok I have the following:
Code:
::CPropertySheet nameSheet( "Hobby List");
CNamePage pgName;
CHobbyPage pgHobby;
nameSheet.AddPage(&pgName);
nameSheet.AddPage(&pgHobby);
nameSheet.DoModal();
I'm using VS6, I don't see a Property Sheet Control. Do I have to import it from the Gallery?
Also, how do I set the position on where I want it to be placed in my dialog/formview.
Rate this post if it helped you.
-
September 13th, 2010, 09:50 AM
#12
Re: Function to Draw Controls from a different dialog box template
As mentioned in my first post, set the style of the property sheet to child.
Then inside the parent dialog use CreateWindow to create the sheet (and DestroyWindow).
Btw, does the dialog hold any other controls besides what is contained within the 'group' of controls?
-
September 13th, 2010, 10:49 PM
#13
Re: Function to Draw Controls from a different dialog box template
I'm not sure if you are talking about CPropertySheet or CPropertyPage.
There is no way I can see of as setting CPropertySheet to wizard mode as there is no control for it.
Still don't see how you position the the PropertyPage. ... all I get is a popup centered on the screen.
Rate this post if it helped you.
-
September 14th, 2010, 02:58 AM
#14
Re: Function to Draw Controls from a different dialog box template
Please, search MSDN for something like using cpropertysheet cpropertypage...
Victor Nijegorodov
-
September 14th, 2010, 04:28 AM
#15
Re: Function to Draw Controls from a different dialog box template
It's not very clear what exactly you want to accomplish, so please clarfy the points below:
- you want a property sheet which is is in wizard mode or not?
- you want a property sheet which is child or is owned by a (form) view?
- what exactly this mean?
There is no way I can see of as setting CPropertySheet to wizard mode as there is no control for it.
To see the difference between child and owned, take a look at these FAQs:
Anyhow, the initial idea of using a tab control to switch between viwes or to show/hide different sets of controls is not so good.
Using the property sheet is easier and more elegant.
Last edited by ovidiucucu; September 14th, 2010 at 04:37 AM.
Reason: typo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|