Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello sir,
I had created the label in <b>window form in visual studio</b>,in front of it ,i placed the combobox..ok.I made to drop down three items from the database(mssql).And also i had created the three panel below,one below the other in the same window.I will select one item from the dropdown list,what i want is:its panel will only be <b>visible</b> and other panels are said to be <b>invisible</b>.Again i will select the other item from the list from the dropdown list,now also only its panel as to be displayed below.Remaining panel should be <b>invisible.</b> .I want this to be done in<b> windows form only</b>.How to achieve this sir
plz do help,need urgent.

Thanks & Reagrds
Pradeep CB
Posted
Updated 6-Mar-12 3:53am
v2

1 solution

C#
private bool HidePanels()
{
    panel1.Visible = false;
    panel2.Visible = false;
    panel3.Visible = false;
}


Set Comboes Tag = related Panels in Form_Laod
for example:

C#
myCombo1.Tag = Panel1;
myCombo2.Tag = Panel2;
myCombo3.Tag = Panel3;


In DropDown event of Comboes

C#
HidePanels(); 
((Panel)(((ComboBox)sender)).Tag).Visible = true;
 
Share this answer
 
v4

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