|
-
July 10th, 2005, 06:40 PM
#1
BringToFront changes Control order
Hi,
I am using numerous panels (let's call them A-panels) which are added on a host panel. To access them I use host.Controls[index]. On the host panel, there are some other panels which should in the foreground. They must be visible, so I call their BringToFront method. Unfortunately this function disorders the A-panels which makes it impossible to index them.
Is there a way to bring the panels to the front without changing the order in host.Controls?
gbr
-
July 10th, 2005, 07:02 PM
#2
Re: BringToFront changes Control order
Is there a way to bring the panels to the front without changing the order in host.Controls?
Probably not, why not have a separate list for your "a-panels", and use that list for "indexing"?
- petter
-
July 10th, 2005, 07:07 PM
#3
Re: BringToFront changes Control order
I wanted to have stored their references only once (in host.Controls). If I won't find any solution I must use a separate list...
gbr
-
July 10th, 2005, 07:17 PM
#4
Re: BringToFront changes Control order
Well, if you read MSDNs remaks section of Control.ControlCollection.SetChildIndex(...)
When SetChildIndex is called, the Control referred to by the child parameter is moved to the position specified by newIndex and the other Control references in the Control.ControlCollection are reordered to accommodate the move. The control with an index value of zero is at the top of the z-order, and higher numbers are closer to the bottom.
.. you'll see that the collection index is related to the z-order.
- petter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|