Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » About the mouse-click event on CExtControlBar Collapse All
Subject Author Date
mai mike Aug 26, 2008 - 8:25 AM

Dear Technical Team,

I have created 2bars which are derived from CExtControlBar in the application and override this method:

void CExtControlBar::OnNcAreaButtonsReinitialize()
    INT nCountOfNcButtons = NcButtons_GetCount();
    if( nCountOfNcButtons > 0 )
    NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
    NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
    // NcButtons_Add( new CExtBarNcAreaButtonExpand(this) );
    // NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
}In it,  I replace the line:


NcButtons_Add( new CExtBarNcAreaButtonClose(this) );with


NcButtons_Add( new CMyNcAreaButtonClose(this) );

class named CMyNcAreaButtonClose derive from CExtBarNcAreaButtonClose ,and then override the OnNcAreaClicked() method to catch mouse-click events.

But I met a problem is.

If  there  bars aren’t in  tab group, means maybe one bar at left side, the other at right side. The method named OnNcAreaClicked() will

be invoked when the user click the close button(’X’) to close the bars.

But if there bars in tab group, means both bars at left side or right side. the method named OnNcAreaClicked() will not be invoked.

What’s the matter?

At this situation, How can I catch mouse-click event?

Thank you in advance.

Best regards,

Mike Mai

Technical Support Aug 26, 2008 - 12:41 PM

The tabbed bar groups are also control bars. They are instances of the CExtDynTabControlBar class. You should also code a similar CExtDynTabControlBar-derived class which implements its own buttons and makes Prof-UIS using it.

How to implement a CExtDynTabControlBar-derived class with the CExtControlBar::g_nMsgCreateTabbedBar registered message is described in the FAQ How to remove the close button ("X") from the control bar(

The following discussion is also related to custom coded tabbed bars: