CComboBox
-
I have an owner drawn combo box where i do drawing in DrawItem function I am placing a combo box in the resource editor and setting its properties to ownerdrawvariable and has strings. When I do this it works fine but I want to set these from the code because i won't have to remember them all the time. I did this void CXXXCombo::PreSubclassWindow() { ModifyStyle (0,CBS_OWNERDRAWVARIABLE|CBS_HASSTRINGS); CComboBox::PreSubclassWindow (); } it did not work. Why ? How can i set these from the code by subclassing a combobox Thanks.
-
I have an owner drawn combo box where i do drawing in DrawItem function I am placing a combo box in the resource editor and setting its properties to ownerdrawvariable and has strings. When I do this it works fine but I want to set these from the code because i won't have to remember them all the time. I did this void CXXXCombo::PreSubclassWindow() { ModifyStyle (0,CBS_OWNERDRAWVARIABLE|CBS_HASSTRINGS); CComboBox::PreSubclassWindow (); } it did not work. Why ? How can i set these from the code by subclassing a combobox Thanks.
Ok, now i'm kinda a beginner but, I think you need to use GetStyle and then or(|) the other to style bits on top of the getstyle return.
-
I have an owner drawn combo box where i do drawing in DrawItem function I am placing a combo box in the resource editor and setting its properties to ownerdrawvariable and has strings. When I do this it works fine but I want to set these from the code because i won't have to remember them all the time. I did this void CXXXCombo::PreSubclassWindow() { ModifyStyle (0,CBS_OWNERDRAWVARIABLE|CBS_HASSTRINGS); CComboBox::PreSubclassWindow (); } it did not work. Why ? How can i set these from the code by subclassing a combobox Thanks.
Put your ModifyStyle() call in PreCreateWindow() instead. --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.