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

Thread: Tab Controls

  1. #1
    Join Date
    Apr 2005
    Posts
    1,776

    Tab Controls

    I am working on an MS Office Addin developed in ATL COM. There is an option dialog which has a tab control inside having Property Sheets like this

    Code:
    class COptions_Buffers : public WTL::CPropertyPage<IDD_OPTIONS_BUFFERS>
    {
    ..........................................
    ..........................................
    }
    These property sheets are invoked using DoModal

    Code:
    COptionsBox::COptionsBox(const HINSTANCE & hResourceInstance,
    						 DWORD * pUpdateCommand,
    						 const DWORD dwMask):
    	m_hResourceInstance(hResourceInstance)
    {
    	//WTL::CPropertySheet sheet( CUtils::GetResourceString( IDS_GUI_OPTIONS_OPTIONS ).c_str() );
    	COptionsSheet sheet( CUtils::GetResourceString_( IDS_GUI_OPTIONS_OPTIONS ).c_str() );
    
    	sheet.m_psh.dwFlags &= ~PSH_HASHELP;
    
    	HICON hIcon = LoadIcon(m_hResourceInstance, MAKEINTRESOURCE(IDI_ICON1));
    	sheet.m_psh.hIcon = hIcon;
    	sheet.m_psh.dwFlags |= PSH_USEHICON;
    
    	//COptions_CriticalChain	page8;
    	COptions_Buffers		page1;
    	//COptions_Statusing		page10;
    	COptions_Update			page9;
    	COptions_UnDo			page6;
    	COptions_Trend			page5;
    	COptions_CCPMView		page2;
    	COptions_Colors			page3;
    	COptions_Toolbar		page4(pUpdateCommand);
    	//COptions_Fields			page11;
    
    	if(dwMask & 1) //general
    	{
    		throw EXCEPTION_IMPLEMENTATION;
    		//sheet.AddPage(page8);
    	}
    
    	if(dwMask & 2) //buffers
    	{
    		sheet.AddPage(page1);
    	}
    
    	/*if(dwMask & 4)
    	{
    		sheet.AddPage(page10);
    	}*/
    
    	if(dwMask & 8)
    	{
    		sheet.AddPage(page9);
    	}
    
    	if(dwMask & 16)
    	{
    		sheet.AddPage(page6);
    	}
    
    	if(dwMask & 32)
    	{
    		sheet.AddPage(page5);	
    	}
    
    	if(dwMask & 64) //view
    	{
    		sheet.AddPage(page2);
    	}
    
    	if(dwMask & 128)
    	{
    		sheet.AddPage(page3);
    	}
    
    	if(dwMask & 256)
    	{
    		sheet.AddPage(page4);
    	}
    
    	if(dwMask & 512)
    	{
    		throw EXCEPTION_IMPLEMENTATION;
    		//sheet.AddPage(page11);
    	}
    
    	sheet.DoModal();
    }
    The main parent window has got an Apply button which is by default disabled and I want to enable it when the user clicks on any of the radio button inside its child property page. How can I do that??

    Thanks in Advance

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,642

    Re: Tab Controls

    Add a handler for those radio buttons and in it call EnableWindow for the apply button.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center