Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Guys

Hope you can help me ! I have a application that opens a instance of a class called controller class each time you click on a different treeview node. the class then creates a panel in a tabpage. In my Controllerclass i references another class (Commentclass) creating a other panel with different controls on. My problem is that when i reference Comment class I make the 1st panel visibility false but when i want to make it true from comment class i cant

Can anyone please advice?


Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 15-Jun-11 2:34am    
What do you want to achieve?
--SA
Sander Rossel 15-Jun-11 2:36am    
Could you post some code?

1 solution

You have to maintain a reference to the 1st panel in the second if you want to do this: Create a class level Panel varaiable and where you hide the panel, save the reference to the panel you just hid. You can then use this to show the panel later.
C#
private Panel myOtherPanel = null;
...
theOtherPanel.Visible = false;
myOtherPanel = theOtherPanel;
...
if (myOtherPanel != null)
   { 
   myOtherPanel.Visible = true;
   }
 
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