CComboBox height
-
Hi. I'm writing an application that it create a CComboBox at runtime like this:
rcControl.left = long(rcClient.Width() * 0.05); rcControl.top = long(rcClient.Height() * 0.10); rcControl.right = rcControl.left + long(rcClient.Width() * 0.90) ; rcControl.bottom = rcControl.top +long(rcClient.Height() * 0.40); m_cboParam.Create(CBS_DROPDOWNLIST|LBS_STANDARD|CBS_SORT|WS_CHILD|WS_VISIBLE, rcControl, this, IDC_PARAM); ....
It works, but the problem is that I want to show more items when the user pull the list down. At the moment it shows just two items and I must scroll the list down to see the rest of them. How could I set, maybe the heigth or something else, so it will be able to show more than two items.?? (at least 4 or 5). Setting the amount of items to show in a combobox at design time is easy:->, just clicking over the arrow and then stretch it to the desire height. But how could I set that at runtime??:doh: Thank you.Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
-
Hi. I'm writing an application that it create a CComboBox at runtime like this:
rcControl.left = long(rcClient.Width() * 0.05); rcControl.top = long(rcClient.Height() * 0.10); rcControl.right = rcControl.left + long(rcClient.Width() * 0.90) ; rcControl.bottom = rcControl.top +long(rcClient.Height() * 0.40); m_cboParam.Create(CBS_DROPDOWNLIST|LBS_STANDARD|CBS_SORT|WS_CHILD|WS_VISIBLE, rcControl, this, IDC_PARAM); ....
It works, but the problem is that I want to show more items when the user pull the list down. At the moment it shows just two items and I must scroll the list down to see the rest of them. How could I set, maybe the heigth or something else, so it will be able to show more than two items.?? (at least 4 or 5). Setting the amount of items to show in a combobox at design time is easy:->, just clicking over the arrow and then stretch it to the desire height. But how could I set that at runtime??:doh: Thank you.Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
Forget it.;P Solved. I had just to adjust the height in other function when the controls reposition. :rolleyes: Thank you.
Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
-
Hi. I'm writing an application that it create a CComboBox at runtime like this:
rcControl.left = long(rcClient.Width() * 0.05); rcControl.top = long(rcClient.Height() * 0.10); rcControl.right = rcControl.left + long(rcClient.Width() * 0.90) ; rcControl.bottom = rcControl.top +long(rcClient.Height() * 0.40); m_cboParam.Create(CBS_DROPDOWNLIST|LBS_STANDARD|CBS_SORT|WS_CHILD|WS_VISIBLE, rcControl, this, IDC_PARAM); ....
It works, but the problem is that I want to show more items when the user pull the list down. At the moment it shows just two items and I must scroll the list down to see the rest of them. How could I set, maybe the heigth or something else, so it will be able to show more than two items.?? (at least 4 or 5). Setting the amount of items to show in a combobox at design time is easy:->, just clicking over the arrow and then stretch it to the desire height. But how could I set that at runtime??:doh: Thank you.Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
Demian Panello wrote:
rcControl.left = long(rcClient.Width() * 0.05); rcControl.top = long(rcClient.Height() * 0.10); rcControl.right = rcControl.left + long(rcClient.Width() * 0.90) ; rcControl.bottom = rcControl.top +long(rcClient.Height() * 0.40); m_cboParam.Create(CBS_DROPDOWNLIST|LBS_STANDARD|CBS_SORT|WS_CHILD|WS_VISIBLE, rcControl, this, IDC_PARAM);
RECT given while creating combo box should mention that. ie. in this case increase
rcControl.bottom
value, it will give you desired effect.Demian Panello wrote:
But how could I set that at runtime??
It is easy ,too. Isn't it?
Prasad Notifier using ATL | Operator new[],delete[][^]