?
Solved

How to dynamically change a CComboBox from dropdown to dropdown list

Posted on 2004-03-22
7
Medium Priority
?
1,405 Views
Last Modified: 2013-11-20
How can you change the type of a CComboBox from a dropdown to a dropdownlist after a dialog box has been created? Just changing the window style from CBS_DROPDOWN to CBS_DROPDOWNLIST does not seem to be enough.
0
Comment
Question by:KelvinUnit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 10649275
Not all window styles can be changed dynamically. If you try this using SetWindowLong or ModifyStyle and it doesn't work, consider using another solution. For example, two combo boxes with different styles, only one of them is visible. Instead of changing the style hide one and show another.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 10883990
try to call this method for the ComboBox:
    ModifyStyle(CBS_DROPDOWN, CBS_DROPDOWNLIST, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER);
and
    ModifyStyle(CBS_DROPDOWNLIST, CBS_DROPDOWN, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER);
alternatively.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11857823
Still awaiting for author feedback
0
 

Author Comment

by:KelvinUnit
ID: 11870690
I intend to ask for this question to be closed and for a refund. Jaime's answer suggests something that I have said does not work in the question and Alex is really just stating the obvious.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question