c++ combo list box
-
Hi, I am trying to add a combo box to provide a list of choice to the user. I add it to a dialogue box and entered Listbox items, but when I try to run to see the list, it is not there. I guess I need more work to make it work for me. Please direct me Thanks
-
Hi, I am trying to add a combo box to provide a list of choice to the user. I add it to a dialogue box and entered Listbox items, but when I try to run to see the list, it is not there. I guess I need more work to make it work for me. Please direct me Thanks
mrby123 wrote:
...and entered Listbox items...
How?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
mrby123 wrote:
...and entered Listbox items...
How?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
You need to size the control by clicking on its down-arrow and draging the control to the desired height.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
You need to size the control by clicking on its down-arrow and draging the control to the desired height.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
I got the combo box working. I can select an item and retrieve the value. However, the combo box is empty by default if the user does not select an item. How to set an default value if the user does not or forget to select a value? Thanks
Use
SetWindowText()
orSetCurSel()
."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Use
SetWindowText()
orSetCurSel()
."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
Thanks. That works. In the simple application I have two dialogue box. One is for input and the other for display results. I use Edit box to display results of calculated numbers (float or int). Then each edit box have a tittle above it by Static Text. Ideally I can change the static text according to the input since this static text should show the unit of the displayed numbers. The unit depends on the input selection of the units. How to change the static text on fly by the application according to the input selection from the input combo box. Thanks a lot
-
Thanks. That works. In the simple application I have two dialogue box. One is for input and the other for display results. I use Edit box to display results of calculated numbers (float or int). Then each edit box have a tittle above it by Static Text. Ideally I can change the static text according to the input since this static text should show the unit of the displayed numbers. The unit depends on the input selection of the units. How to change the static text on fly by the application according to the input selection from the input combo box. Thanks a lot
mrby123 wrote:
How to change the static text on fly by the application...
Use
SetWindowText()
."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
mrby123 wrote:
How to change the static text on fly by the application...
Use
SetWindowText()
."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
m_pv_unit is declared in the header file of Class A: CString m_pv_unit; which is assigned value from Combo Box. Class B is the for the output display. Class B includes the header file of Class A. However, I tried to use the variable: m_pv_unit to change the static text (the tittle of the output edit box), I got error message from the compile: 'm_pv_unit' : undeclared identifier How to make: m_pv_unit to be see in Class B ? Or how to pass the variable: m_pv_unit and its value in Class A to methods in Class B. Class B (its methods) is called by Class A. The method of Class B displays the results processed by Class A. Thanks
modified on Friday, May 21, 2010 1:02 AM
-
m_pv_unit is declared in the header file of Class A: CString m_pv_unit; which is assigned value from Combo Box. Class B is the for the output display. Class B includes the header file of Class A. However, I tried to use the variable: m_pv_unit to change the static text (the tittle of the output edit box), I got error message from the compile: 'm_pv_unit' : undeclared identifier How to make: m_pv_unit to be see in Class B ? Or how to pass the variable: m_pv_unit and its value in Class A to methods in Class B. Class B (its methods) is called by Class A. The method of Class B displays the results processed by Class A. Thanks
modified on Friday, May 21, 2010 1:02 AM
mrby123 wrote:
m_pv_unit is declared in the header file of Class A: CString m_pv_unit; which is assigned value from Combo Box.
I suggest using
CComboBox
object instead."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius