panel->Visible = true; /false;

Reply

Join Date: Feb 2008
Posts: 518
Reputation: Jennifer84 is an unknown quantity at this point 
Solved Threads: 1
Jennifer84 Jennifer84 is offline Offline
Posting Pro

panel->Visible = true; /false;

 
0
  #1
Jun 24th, 2008
I have a little problem with two panels that are on top of eachother with the exact same Size.
What I am trying to do is with 2 buttons to choose wich panel that will be visible and not visible.
So what should happen is that only one panel can be seen at a time.

The Form starts with default panel43->Visible = true;

If I now press button37, panel41 will be seen but now when I press button36, both panels is Visible = false; it seems because I will see the background color of the Form, so no panels is Visible.
I might wonder what this could depend on...
  1. private: System::Void button36_Click(System::Object^ sender, System::EventArgs^ e)
  2. {
  3.  
  4. panel43->Visible = true;
  5. panel41->Visible = false;
  6.  
  7. }
  8. private: System::Void button37_Click(System::Object^ sender, System::EventArgs^ e)
  9. {
  10.  
  11. panel41->Visible = true;
  12. panel43->Visible = false;
  13.  
  14. }
Last edited by Jennifer84; Jun 24th, 2008 at 6:20 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 513
Reputation: Jishnu will become famous soon enough Jishnu will become famous soon enough 
Solved Threads: 26
Jishnu's Avatar
Jishnu Jishnu is offline Offline
Posting Pro

Re: panel->Visible = true; /false;

 
0
  #2
Jun 24th, 2008
I have a little problem with two panels that are on top of eachother with the exact same Size.
What I am trying to do is with 2 buttons to choose wich panel that will be visible and not visible.
So what should happen is that only one panel can be seen at a time.
Instead of keeping two buttons for this task, why not use two radio buttons? This would be more appropriate as you want only one of the panels to be visible at a time.
"You know you're a computer geek when you try to shoo a fly away from the monitor screen with your cursor. That just happened to me. It was scary." - Juuso Heimonen.

"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 1,294
Reputation: mitrmkar is a splendid one to behold mitrmkar is a splendid one to behold mitrmkar is a splendid one to behold mitrmkar is a splendid one to behold mitrmkar is a splendid one to behold mitrmkar is a splendid one to behold 
Solved Threads: 267
mitrmkar mitrmkar is offline Offline
Nearly a Posting Virtuoso

Re: panel->Visible = true; /false;

 
0
  #3
Jun 25th, 2008
This seems to be a feature in VS. If you look into the Form's InitializeComponent() code, you'll see that the Designer has added the second panel as a control of the first one, i.e. something like:

this->panel43->Controls->Add(this->panel41);

This arrangement seems to occur acutomatically whenever the two panels overlap in the Form Designer. So maybe you have to devise something else instead of overlapping panels.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 518
Reputation: Jennifer84 is an unknown quantity at this point 
Solved Threads: 1
Jennifer84 Jennifer84 is offline Offline
Posting Pro

Re: panel->Visible = true; /false;

 
0
  #4
Jun 25th, 2008
Yes, thats right. I will have to find another solution. I will experiment on that.
Thank you for the information.

j

Originally Posted by mitrmkar View Post
This seems to be a feature in VS. If you look into the Form's InitializeComponent() code, you'll see that the Designer has added the second panel as a control of the first one, i.e. something like:

this->panel43->Controls->Add(this->panel41);

This arrangement seems to occur acutomatically whenever the two panels overlap in the Form Designer. So maybe you have to devise something else instead of overlapping panels.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1921 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC