keyongtech


  keyongtech > dotnet.framework.* > dotnet.framework.windowsforms > 06/2004

 #1  
06-18-04, 02:44 PM
Wesam
Hi all,

I got a problem: I have a Panel control which has many mixed child controls
(buttons, checkboxes, comoboxes). All controls are visible (the parent
container Panel is also visible). My problem is that when I set the Visible
property of the Panel to false and try to read the Visible property of any
of its child control, the result is always false??? How can I get the
original value of the Visible property of any child control??

I'd appreciate your prompt reply,

Thanks a lot ..

Veszko

/****************************/

Panel pnl = new Panel();
..
..
..
pnl.Visible = true;

Button btn = new Button();
..
..
..
btn.Visible = true;

pnl.Controls.Add(btn);

..
..
..
MessageBox.Show(pnl.Visible.ToString()); // The result is "True"
MessageBox.Show(btn.Visible.ToString()); // The result is "True"

pnl.Visible = false;

MessageBox.Show(pnl.Visible.ToString()); // The result is "False"
MessageBox.Show(btn.Visible.ToString()); // The result is "False" ...
which is not OK!!!

// I need to know the original value of "btn.Visible"

/****************************/
 #2  
06-20-04, 02:58 AM
Mike McClaran
I don't know for sure, but I suspect this is by design. Maybe someone from
Microsoft could confirm this.

"Wesam" <public_2000> wrote in message
news:2992
[..]
 #3  
06-22-04, 12:44 PM
Wesam
Can anyone help?? It is very important for me??

Thanks

Veszko

"Mike McClaran" <mikemcclaran> wrote in message
news:ad04
[..]
Similar Threads
How to ensure "child" ascx control loads before parent Load

Hi, I have a .ascx control which holds company information which can be edited. One of the controls inside this is an Address control. The address control has country and...

Implement "visible" property for composite control (for Igor)

Igor, I saw your post from a few years back where you responded to someone asking how to implment the concept of visible with this statement: > You are not supposed to...

Implement "visible" property for composite control.

Hi, I am designing a composite control and I want to provide the property "visible" on the control. The intention is to make the control visible / invisible at run time...

The "Visible" property of a parent control ruins that one of its child controls

Hi all, I got a problem: I have a Panel control which has many mixed child controls (buttons, checkboxes, comoboxes). All controls are visible (the parent container Panel is...

Is there a way to make an ASP.Net control invisible other than the "visible" property?

I have some controls that I want to be invisible, but if the user does something, they will become visible using javascript. So I can't set its "visible" property to false,...


All times are GMT. The time now is 07:26 AM. | Privacy Policy