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

    How to Clone MS Tabbed Dialog Control

    I'm trying to clone the Microsoft Tabbed Dialog Control in an MFC ActiveX control [I have special look and feel requirement]. I've been able to subclass SysTabControl32 and get access to all the behavior I want with one big exception.

    The MS Tabbed Dialog Control available in VB6 somehow knows which tab another control was placed on. As you select different tabs, the controls you placed on them in design mode appear and disappear based on the selected tab without any programming. I'm stumped at how to make this behavior work in my control. Any ideas?

    Thanks,

    Keith


  2. #2
    Join Date
    Apr 1999
    Posts
    3

    Re: How to Clone MS Tabbed Dialog Control

    Okay I figured this out. In the unlikely event that someone else cares, here's what you do.

    When you create the MFC Active X control be sure to select "Acts as simple frame control".

    You then need add the OnParentNotify(UINT message, LPARAM lParam) message support.

    The high word of the first argument gives you the child id of the control being updated. The low word can be several message but WM_CREATE and WM_DESTROY tell you when a control is created or deleted.

    Map a control to the current tab when it is created.
    Save the tab/child id relationship in DoPropExchange.

    You can convert the child ID to a CWnd pointer with the CWnd::GetDlgItem() method. All that you need to do once you have that is call ShowWindow(SW_SHOW) or ShowWindow(SW_HIDE) depending on the current tab selected.

    That's it. It's pretty straightforward.

    Keith


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