DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 22 Aug 2007 03:20:01 -0700,    posted on: microsoft.public.dotnet.general        back       

Thread Index
  1    Fredrik
          2    Kevin Spencer
                 3    Fredrik
                 4    Kevin Spencer


Visible controls reports not visible   
Hi
I have a problem in one of my user controls that I cannot find any solution 
for. 
I'am running C# for Visual studio 2003 and developing a windows application.
The problem is the following:
I have a user control with several panels inside it. Each panel is docked at 
top, which means that if one panel is hidden, the panels underneath it will 
move up to cover the newly hidden area (basic information, I know, but just 
to clarify :-). Forms in my application that are using this control should 
adjust their heights, so that the user control fits into them, without any 
blank area.
In this user control I have some properties that can be set to true/false, 
which in turns shows or hides the panels.
Now to the strange thing: When hiding some of the panels, I want to change 
the size of the user control not to have any blank area in it. This is done 
by looping through all of the panels in the control and checking the visible 
property. The panel with the location at the bottom that has its visible 
property set to true decides the height of the control.
The problem is that all panels report their visible property set to false 
when looping through them - always. Even if they report their visible 
property to false, the panels that should be visible (according to the 
properties I have) are visible, so the control behaves correctly in this 
case. The problem is that the reported height of the control is not ok.
The application is only running in one thread.
Have anyone a solution to this?

/Fredrik
Date:Wed, 22 Aug 2007 03:20:01 -0700   Author:  

Re: Visible controls reports not visible   
When a Control is hidden, by virtue of being underneath another Control, its 
Visible property is false. Rather than setting the Visible property, why not 
just use the BringToFront method of the Control to bring it to the top, then 
resize the UserControl to fit the top Panel?

-- 
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Fredrik"  wrote in message 
news:56691367-E8BE-4A91-BA0C-FA75F3AE6B6B@microsoft.com...

> Hi
> I have a problem in one of my user controls that I cannot find any 
> solution
> for.
> I'am running C# for Visual studio 2003 and developing a windows 
> application.
> The problem is the following:
> I have a user control with several panels inside it. Each panel is docked 
> at
> top, which means that if one panel is hidden, the panels underneath it 
> will
> move up to cover the newly hidden area (basic information, I know, but 
> just
> to clarify :-). Forms in my application that are using this control should
> adjust their heights, so that the user control fits into them, without any
> blank area.
> In this user control I have some properties that can be set to true/false,
> which in turns shows or hides the panels.
> Now to the strange thing: When hiding some of the panels, I want to change
> the size of the user control not to have any blank area in it. This is 
> done
> by looping through all of the panels in the control and checking the 
> visible
> property. The panel with the location at the bottom that has its visible
> property set to true decides the height of the control.
> The problem is that all panels report their visible property set to false
> when looping through them - always. Even if they report their visible
> property to false, the panels that should be visible (according to the
> properties I have) are visible, so the control behaves correctly in this
> case. The problem is that the reported height of the control is not ok.
> The application is only running in one thread.
> Have anyone a solution to this?
>
> /Fredrik 
Date:Wed, 22 Aug 2007 08:04:48 -0400   Author:  

Re: Visible controls reports not visible   
Thanks for the answer.

My bad english is also playing in this :-)
The panels are not underneeth each other, they are stacked. All panels are 
in the same containter (the user control's main area). With all panel's dock 
property set to TOP, they are stacked on each other meaning that if the first 
panel has its location at 0,0 and a height of 100, the second panel gets its 
location to 0,100 etc. When setting the first panels visible property to 
false, the second panel is automatically moved to 0,0.
So my intension is to check which panel is at bottom, and is visible (with 
its Location or Top property higher than other panels). 
But when I check the panel's visible property, all panels have "false" even 
if they are visible. 
I'll try to show below how I mean in more detail:
My user control contains 4 panels, A,B,C and D, all in the same container. 
They are visually as shown below:
A
B
C
D
In some cases, I want to hide panels C or D. Lets assume that panel C is to 
be hidden. When setting the visible property to false for panel C, panel D 
moves up to panel C's old position (due to the dock property). Then I want to 
check their visible property, but this always return false.
I've seen then phenomena when setting properties for visual controls from 
another thread, but in this case I only have 1 thread.

Long explenation, but hope it will show what I want, and explain more in 
detail what my problem is.
/Fredrik

"Kevin Spencer" wrote:


> When a Control is hidden, by virtue of being underneath another Control, its 
> Visible property is false. Rather than setting the Visible property, why not 
> just use the BringToFront method of the Control to bring it to the top, then 
> resize the UserControl to fit the top Panel?
> 
> -- 
> HTH,
> 
> Kevin Spencer
> Microsoft MVP
> 
> DSI PrintManager, Miradyne Component Libraries:
> http://www.miradyne.net
> 
> "Fredrik"  wrote in message 
> news:56691367-E8BE-4A91-BA0C-FA75F3AE6B6B@microsoft.com...
> > Hi
> > I have a problem in one of my user controls that I cannot find any 
> > solution
> > for.
> > I'am running C# for Visual studio 2003 and developing a windows 
> > application.
> > The problem is the following:
> > I have a user control with several panels inside it. Each panel is docked 
> > at
> > top, which means that if one panel is hidden, the panels underneath it 
> > will
> > move up to cover the newly hidden area (basic information, I know, but 
> > just
> > to clarify :-). Forms in my application that are using this control should
> > adjust their heights, so that the user control fits into them, without any
> > blank area.
> > In this user control I have some properties that can be set to true/false,
> > which in turns shows or hides the panels.
> > Now to the strange thing: When hiding some of the panels, I want to change
> > the size of the user control not to have any blank area in it. This is 
> > done
> > by looping through all of the panels in the control and checking the 
> > visible
> > property. The panel with the location at the bottom that has its visible
> > property set to true decides the height of the control.
> > The problem is that all panels report their visible property set to false
> > when looping through them - always. Even if they report their visible
> > property to false, the panels that should be visible (according to the
> > properties I have) are visible, so the control behaves correctly in this
> > case. The problem is that the reported height of the control is not ok.
> > The application is only running in one thread.
> > Have anyone a solution to this?
> >
> > /Fredrik 
> 
> 
> 
Date:Wed, 22 Aug 2007 10:32:03 -0700   Author:  

Re: Visible controls reports not visible   
Hi Fredrik,

That is odd. I have not tried something similar, but I will take your word 
that this is what you are seeing.

I suppose you will have to implement a tracking mechanism to keep track of 
the state of the Panels when it changes.

-- 
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Fredrik"  wrote in message 
news:2E120BC5-1754-433D-B3D7-525172BEED4E@microsoft.com...

> Thanks for the answer.
>
> My bad english is also playing in this :-)
> The panels are not underneeth each other, they are stacked. All panels are
> in the same containter (the user control's main area). With all panel's 
> dock
> property set to TOP, they are stacked on each other meaning that if the 
> first
> panel has its location at 0,0 and a height of 100, the second panel gets 
> its
> location to 0,100 etc. When setting the first panels visible property to
> false, the second panel is automatically moved to 0,0.
> So my intension is to check which panel is at bottom, and is visible (with
> its Location or Top property higher than other panels).
> But when I check the panel's visible property, all panels have "false" 
> even
> if they are visible.
> I'll try to show below how I mean in more detail:
> My user control contains 4 panels, A,B,C and D, all in the same container.
> They are visually as shown below:
> A
> B
> C
> D
> In some cases, I want to hide panels C or D. Lets assume that panel C is 
> to
> be hidden. When setting the visible property to false for panel C, panel D
> moves up to panel C's old position (due to the dock property). Then I want 
> to
> check their visible property, but this always return false.
> I've seen then phenomena when setting properties for visual controls from
> another thread, but in this case I only have 1 thread.
>
> Long explenation, but hope it will show what I want, and explain more in
> detail what my problem is.
> /Fredrik
>
> "Kevin Spencer" wrote:
>
>> When a Control is hidden, by virtue of being underneath another Control, 
>> its
>> Visible property is false. Rather than setting the Visible property, why 
>> not
>> just use the BringToFront method of the Control to bring it to the top, 
>> then
>> resize the UserControl to fit the top Panel?
>>
>> -- 
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>>
>> DSI PrintManager, Miradyne Component Libraries:
>> http://www.miradyne.net
>>
>> "Fredrik"  wrote in message
>> news:56691367-E8BE-4A91-BA0C-FA75F3AE6B6B@microsoft.com...
>> > Hi
>> > I have a problem in one of my user controls that I cannot find any
>> > solution
>> > for.
>> > I'am running C# for Visual studio 2003 and developing a windows
>> > application.
>> > The problem is the following:
>> > I have a user control with several panels inside it. Each panel is 
>> > docked
>> > at
>> > top, which means that if one panel is hidden, the panels underneath it
>> > will
>> > move up to cover the newly hidden area (basic information, I know, but
>> > just
>> > to clarify :-). Forms in my application that are using this control 
>> > should
>> > adjust their heights, so that the user control fits into them, without 
>> > any
>> > blank area.
>> > In this user control I have some properties that can be set to 
>> > true/false,
>> > which in turns shows or hides the panels.
>> > Now to the strange thing: When hiding some of the panels, I want to 
>> > change
>> > the size of the user control not to have any blank area in it. This is
>> > done
>> > by looping through all of the panels in the control and checking the
>> > visible
>> > property. The panel with the location at the bottom that has its 
>> > visible
>> > property set to true decides the height of the control.
>> > The problem is that all panels report their visible property set to 
>> > false
>> > when looping through them - always. Even if they report their visible
>> > property to false, the panels that should be visible (according to the
>> > properties I have) are visible, so the control behaves correctly in 
>> > this
>> > case. The problem is that the reported height of the control is not ok.
>> > The application is only running in one thread.
>> > Have anyone a solution to this?
>> >
>> > /Fredrik
>>
>>
>> 
Date:Thu, 23 Aug 2007 07:58:34 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us