Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
So im making a form application program for a MEWS System which displays vital sign results for a patient at a hospital. Im using a combo box and list box to select the vital sign number and display the score in the list box. I entered in the code but when I run the program it doesnt display the options in the combo box. Whats wrong with my code

C#
private void cbxRespScore_SelectedIndexChanged(object sender, EventArgs e)
        {


            ta = cbxRespScore.SelectedItem.ToString();

            if (ta == "0")
            {

                lbxRespScore.Items.Clear();
                lbxRespScore.Items.Add("3");

            }
            else if (ta == "<40")
            {
                lbxRespScore.Items.Clear();
                lbxRespScore.Items.Add("2");

            }
            else if (ta == "41-50")
            {
                lbxRespScore.Items.Clear();
                lbxRespScore.Items.Add("1");

            }
            else if (ta == "51-100")
            {
                lbxRespScore.Items.Clear();
                lbxRespScore.Items.Add("0");

            }
            else if (ta == "101-110")
            {
                lbxRespScore.Items.Clear();
                lbxRespScore.Items.Add("1");

            }

            else if (ta == "111-130")
            {
                lbxRespScore.Items.Clear();
                lbxRespScore.Items.Add("2");

            }

            else if (ta == ">131")
            {
                lbxRespScore.Items.Clear();
                lbxRespScore.Items.Add("3");

            }



        }
Posted
Updated 4-Dec-10 1:50am
v2

1 solution

Put a debug point at the first if condition and then debug to check
1) the ta value
2) whether your code goes into any of these if conditions.
 
Share this answer
 
Comments
programmer1234 4-Dec-10 8:11am    
Still isnt working.
Abhinav S 4-Dec-10 8:17am    
Is there a value in ta?
programmer1234 4-Dec-10 8:20am    
yes
Abhinav S 4-Dec-10 11:55am    
What is it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900