|
-
May 19th, 1999, 01:54 AM
#1
How to change combobox to ownerdraw at runtime?
I'd like to change a combobox control to owner-draw at runtime. In the resource script the control is layed out as a standard control.
I've experimented with setting the style bits to CBS_OWNERDRAW | CBS_HASSTRINGS but somehow this does not help.
Does anybody know the trick?
-
May 19th, 1999, 04:21 AM
#2
Re: How to change combobox to ownerdraw at runtime?
Try SetWindowLong() function
-
May 19th, 1999, 09:00 AM
#3
Re: How to change combobox to ownerdraw at runtime?
I used SetWindowLong to or in the CBS_OWNERDRAW | CBS_HASSTRINGS styles.
Thats the code I use:
// turn to ownerdraw
DWORD dwStyle = ::GetWindowLong(hCtrl, GWL_STYLE);
dwStyle |= CBS_OWNERDRAWFIXED | CBS_HASSTRINGS;
VERIFY(0 != ::SetWindowLong(hCtrl, GWL_STYLE, dwStyle));
This code is processed in the WM_INITDIALOG message handler.
Unfortunately it doesn't work.
Anybody already done that?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|