• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1158
  • Last Modified:

modifystyle in ccombobox

At run time I want to change the ccombobox style from CBS_DROPDOWNLIST to CBS_DROPDOWN. I couldn't get it. Can anybody try it ang get?
Please....

Thanks
bhaskar
0
Bhaskar_Y
Asked:
Bhaskar_Y
  • 2
1 Solution
 
RONSLOWCommented:
This is not possible .. the style is set at creation time and cannot be changed (attempting to do so has no effect).

But you can cheat

see:
http://www.codeguru.com/combobox/combo_dropdown_dropdownlist.shtml

which does the same thing (sorta) by making the edit-box readonly

and also:
http://www.codeguru.com/combobox/SwitchCombo.shtml

which emulates an editable combo by creating an edit box over it (sneaky).

The other solution is to have BOTH types of control present at the same location (update both together when editing the contents) and make one or the other visible depending on what you want.
0
 
Bhaskar_YAuthor Commented:
Then what is the purpoes of Modifystyle()


Bhaskar
0
 
RONSLOWCommented:
Some styles (most) CAN be modified at run time.  But some (unfortunately) cannot.  That's just the way Windows is.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now