Print Page | Close Window

How to subclass controls from CommandBarDesigner?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=17694
Printed Date: 28 November 2024 at 11:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to subclass controls from CommandBarDesigner?
Posted By: maxxan
Subject: How to subclass controls from CommandBarDesigner?
Date 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!



Replies:
Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net