CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2008
    Posts
    3

    New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    Hello everybody, I'm actually working on a Vista OS with lasted update for Visual Studio 2008.

    I'm testing there new PropertySheet (where you can interpret the views as tabs dialog or tree dialog view).

    I'm looking for a few days without finding any solution to my problem : I don't know how to manage the view of one CMFCPropertyPage from my CMFCPropertySheet.

    All is more easy with an image : --> As you can see, I don't know how to remove the 3D view of the Child Dialog.

    Every answer will be very helpfull and I thanks you in advance.

    P.S: I create an easy program so you could test it (use Winrar to unzip it).
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    I don't have the latest update to Visual Studio 2008, so I get a compile error that says it's missing the <afxcontrolbars.h> file.

    What I think you are having trouble with is to make the property sheet a child of the parent dialog.

    However, if this is anything like working with a property sheet in the older versions of MFC, when you have an application that only displays a property sheet, you'll want to set the property sheet to open in InitInstance rather than create the normal dialog app dialog and try to make the property sheet appear as its child.

    This is a pretty easy modification. Rather than this.
    Code:
    BOOL CTestPropshApp::InitInstance()
    {
    	AfxEnableControlContainer();
    	CTestPropshDlg dlg;
    	m_pMainWnd = &dlg;
    	int nResponse = (int) dlg.DoModal();
    	return FALSE;
    }
    change InitInstance to this:
    Code:
    BOOL CTestPropshApp::InitInstance()
    {
    	AfxEnableControlContainer();
    	CDialogSheet propSheet (CMFCPropertySheet::PropSheetLook_Tree);
    	m_pMainWnd = &propSheet;
    	int nResponse = (int) propSheet.DoModal();
    	return FALSE;
    }

  3. #3
    Join Date
    May 2008
    Posts
    3

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    Thank you Arjay for your answer.

    As you say, I thought that it was something like making the propertypage as a child of the propertysheet. I change that with the IDE of Visual Studio 2008, but nothing changed. In fact, I tryed every property possibilities with the IDE to my child dialog without removing my problem.

    I use the property sheet as tool box to customize parameters of my application. So it cann't be my main application.
    However, I change the code to see if something change but it was always the same.

    I really don't know what to do...

    Thanks in advance for any answer.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    I just noticed this. In the DIALOG1 (property page) resource, change the style from Popup to Child.

  5. #5
    Join Date
    May 2008
    Posts
    3

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    Thank you Arjay for your answer.

    Sorry, I didn't notice that I send the code with that parameter.

    But I've tryed all styles in the properties and it doesn't change anything (Overlapped, popup, child, transparent, hidden at the creation , ...)

    I don't know where to look at to find any solution.

  6. #6
    Join Date
    May 2009
    Posts
    2

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    Hi Arjay,
    I have an application, running on my system very well but when i try to run on another system,
    at compile time, it show an error " afxcontrolbars.h" is missing.

    Please solve this problem.

    ASAP

    Thanks in advance

  7. #7
    Join Date
    Mar 2010
    Posts
    1

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    Hi JSmey,

    Did you resolve this issue? Would be very interested in knowing the soulution as I have the same problem.

    Thanks

  8. #8
    Join Date
    Aug 2010
    Posts
    1

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    Seems like the TreeView of the PropertySheet is a really pretty feature you can't use. Actually I'm trying to get this one working for the third time - this time with more success but still there are some glitches.

    What I think is that in the TreeView you still have the original TabCtrl (beside the additional controls) but the buttons to select the pages are not visible (don't know if they are still there). If you switch to PropSheetLook_Tabs you'll find your 3D-view surrounding the Pages. You just have to get rid of it changing the window style of the TabCtrl. I did it in the OnInitDialog:
    Code:
    	CMFCPropertySheet::OnInitDialog();
    	if(GetLook() == CMFCPropertySheet::PropSheetLook_Tree)
    	{
    		CTabCtrl *pTabCtrl= GetTabControl();
    		pTabCtrl->ModifyStyle(TCS_TABS | TCS_MULTILINE, TCS_BUTTONS);
    		pTabCtrl->Invalidate();
    My problem now is the CTreeCtrl on the left side. I don't see any icons (even in the posted example application) and the control looks like win2k style and not like windows xp style I'm working with. As pages I have only list controls. The border of the list controls in windows xp is just a thin line (in a kind of blue) - the one of the tree not. When switching the windows theme to win2k both controls in the sheet have the same border style. Anyone an idea how to fix this and get the 'flat' looking border on the contained CTreeCtrl?

  9. #9
    Join Date
    Nov 2011
    Posts
    4

    Re: New MFC based on Visual Studio 2008 problems(CMFCPropertySheet)

    When CMFCPropertySheet::PropSheetLook_List option is used , scroll bars are not displayed

    ----------------------------------------------------------------------------------------------------------------------

    According to MSDN :

    For PropSheetLook_List

    The framework displays scroll arrows if there are more list items than will fit in the visible area of the list.

    Unfortunately, scroll bars are not displayed when there are many items presents outside visible area.

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