|
-
June 8th, 1999, 11:07 AM
#1
CComboBox ModifyStyle() not working?
hi,
does anybody have a clue why this is not working?
myCombo.ModifyStyle(CBS_DROPDOWN, CBS_DROPDOWNLIST);
or this:
myCombo.ModifyStyle(CBS_DROPDOWNLIST, CBS_DROPDOWN);
and this always returns the first option no matter what is the real style (in that case "CBS_DROPDOWN"):
DWORD d = myCombo.GetStyle();
if (d & CBS_DROPDOWN)
AfxMessageBox("CBS_DROPDOWN");
else
if (d & CBS_DROPDOWNLIST)
AfxMessageBox("CBS_DROPDOWNLIST");
else
if (d & CBS_SIMPLE)
AfxMessageBox("CBS_SIMPLE");
any ideas?
oren.
-
June 8th, 1999, 12:28 PM
#2
Re: CComboBox ModifyStyle() not working?
This type of change requires you to recreate the window. So you need to DestoryWindow();
Create(...
Your other option is to have both control types createdd and then hide the one you don't need and kepp them in sync.
HTH,
Chris
-
June 9th, 1999, 10:01 AM
#3
Re: CComboBox ModifyStyle() not working?
hi Chris,
first - thanks.
second - i had tried both methods and eventually decided on a completely different approach.
even though i have a question and a comment about your first option:
1. how can one know whether a style is 'modifyable' or not?
2. in my endless attempts to modify the style i did manage to modify it correctly,
but then i did some 'improvements' and lost the case. the sad thing was
that somehow i didn't manage to do it again. so - if i'm not wrong, this specific task
can be made without recreating the control.
thanks again, oren.
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
|