Print Page | Close Window

CXTPControlComboBox + Ribbon + ownerdraw prob

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=11460
Printed Date: 12 December 2024 at 8:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlComboBox + Ribbon + ownerdraw prob
Posted By: Joe19
Subject: CXTPControlComboBox + Ribbon + ownerdraw prob
Date Posted: 15 July 2008 at 11:42pm
I have a Ribbon based app.  I am trying to add a CXTPControlComboBox control that will be owner drawn.  It does not have the edit field.
 
I subclass the control.  I set the listbox style to (LBS_OWNERDRAWFIXED | LBS_HASSTRINGS)
 
DrawEditText does gets called whether the style is set or not .
 
No matter which way the style is set, DrawItem and MeasureItem do not get called.  If the style is not set, the listbox will do its default draw.  If it is set, the background is filled but that is all.
 
I've looked at the custom themes example but I think the Ribbon may be causing the problem.
 
So I am stumped about how to proceed.
 



Replies:
Posted By: Joe19
Date Posted: 16 July 2008 at 12:07am
OK, figured it out.  when creating the CXTPControlComboBox its constructors default parameter is NULL.  If this value is set to the CommandBars object, the control message reflection will work allowing ownerdraw to work.  You can get the CommandBars object from the ribbonbar with GetCommandBars.



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