|
-
May 13th, 2006, 05:24 AM
#1
Thread Starter
Lively Member
How to change a control's Z-Property?
Hi,
How do I change an Imagebox's Z-Property?
Currently, on the vb.net form, there are a few Imagebox controls. By default, the Imageboxe added later will block the rest of the imageboxes when they are placed on top of each other.
e.g Imagebox3 will block Imagebox1 when they are placed on the same position in the form.
Currently there are 4 imageboxes on the form. How do I make Imagebox3 block the rest of the imageboxes and for imagebox4 to block out imageboxes 1 and 2?
Is it possible to change each control's z-property individually?
-
May 13th, 2006, 05:28 AM
#2
Re: How to change a control's Z-Property?
Z-Index?
I think there's a ZOrder method, or I might be spouting bilge.
-
May 13th, 2006, 08:38 AM
#3
Re: How to change a control's Z-Property?
It isn't possible to set a contol's position in the z-order explicitly. All you do is call BringToFront or SendToBack on each control in the appropriate order and they will be stacked accordingly. You can do this at run time or you can do it at design time by right-clicking on the control in the design window.
-
May 13th, 2006, 10:47 PM
#4
Thread Starter
Lively Member
Re: How to change a control's Z-Property?
So I'll use something like this:
Imagebox3.BringToFront() 'Covers all the imageboxes
Imagebox4.BringToFront() 'Covers all the imageboxes except for Imagebox3
Is it correct?
-
May 14th, 2006, 12:02 AM
#5
Re: How to change a control's Z-Property?
Wrong. If you call BringToFront on Imagebox3 then it will be brought to the front, so in front of every other control. If you then call BringToFront on Imagebox4 then it will be brought to the front of evey other control including Imagebox3. If you call BringToFront on every control the the first one you call it on will be at the back and the last one will be at the front. The opposite is true of SendToBack. Just imagine that the controls are a pack of cards. If you bring each of the 52 cards to the front, one after the other, then the first one would be end up the back.
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
|