Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Initially, only the panels are visible, and then when the user clicks on a button, the panels will disappear and the label, combobox, and button will appear. But the problem I'm having is that only the label and button appear, and the combobox remains invisible.

Initially the combobox, label, and button overlap with the panel and are just made invisible through coding, but I can't understand why the button and label show up but the combobox won't.




C#
private void Form1_Load(object sender, EventArgs e)
        {
            cboIncome.Visible = false;
            lblIncType.Visible = false;
            btnAdd.Visible = false;

        }

        private void btnIncome_Click(object sender, EventArgs e)
        {
            panel1.Visible = false;
            panel2.Visible = false;
            panel3.Visible = false;
            panel4.Visible = false;
            panel5.Visible = false;

            cboIncome.Visible = true;
            lblIncType.Visible = true;
            btnAdd.Visible = true;

        }
Posted
Comments
CHill60 9-Mar-15 8:15am    
Are you sure that combobox is on the form itself and not contained within one of the panels?

Most probably your combobox may be added as a child control of one of panel you set visible false.
On the View menu in Visual Studio, click Other Windows, and then click Document Outline. The Document Outline window will open.
check in the outline where your combobox located and move it to place where lblIncType and btnAdd located.
 
Share this answer
 
Comments
Member 11477757 9-Mar-15 8:37am    
combo box located in to the penal that's why it not visible. first find the proper solution is that where combo box is located in penal ? then this particular penal make visible true when button click
kmllev 9-Mar-15 8:39am    
The reason why the combobox overlaps with the panel is because when the user clicks on a button, the panels are no longer necessary and they will disappear, and the combobox will take over, but to avoid having to set their location by code, I just put them on the desired locations and just made them invisible at first until they are needed.
kmllev 9-Mar-15 8:37am    
I can't find the Document Outline. I'm using C# 2010 Express
DamithSL 9-Mar-15 8:44am    
try with keyboard Ctrl+W,U
combo box located in to the penal that's why it not visible. first find the proper solution is that where combo box is located in penal ? then this particular penal make visible true when button click
 
Share this answer
 

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