Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPControlComboBox + Ribbon + ownerdraw prob
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlComboBox + Ribbon + ownerdraw prob

 Post Reply Post Reply
Author
Message
Joe19 View Drop Down
Newbie
Newbie


Joined: 11 May 2007
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote Joe19 Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlComboBox + Ribbon + ownerdraw prob
    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.
 
Back to Top
Joe19 View Drop Down
Newbie
Newbie


Joined: 11 May 2007
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote Joe19 Quote  Post ReplyReply Direct Link To This Post 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.
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.156 seconds.