Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to subclass controls from CommandBarDesigner?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to subclass controls from CommandBarDesigner?

 Post Reply Post Reply
Author
Message
maxxan View Drop Down
Groupie
Groupie


Joined: 15 July 2009
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote maxxan Quote  Post ReplyReply Direct Link To This Post Topic: How to subclass controls from CommandBarDesigner?
    Posted: 17 December 2010 at 2:49am
Hi!
If I create my ribbon bars in the command bar designer and add, for example a combo box, how can I later subclass that to my inherited CXTPControlComboBox? Usually I do that in OnCreateControl, but that's not called for controls created in the command bar designer.

So what is the correct/nice way to do it?

This is how it was done before in OnCreateControl:
if (lpCreateControl->nID == ID_MY_CUSTOM_COMBO_BOX)
{
      lpCreateControl->pControl = new MyCustomComboBox();
      return TRUE;
 }

Thanks!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 December 2010 at 4:47am
Hi,

Yes, when you load it from designer OncreateControl won't be called beacause all controls already created in designer.  so you can use CXTPControls::FindControl method, remove old and add new with  CXTPControls::Add method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.406 seconds.