Is there a way to bring one control in front of another via code, in other words, execute the Bring to front function via code? Thanks a lot in advance.
I tend to think that two overlapped visible controls might be confusing. Especially if you don't take one of them out of the tab order, it's gonna get all messy.
I'd still use .visible property.
Jim Me? Ambivalent? Well, yes and no....
Another free Access forum:
I agree, things would probably get messy. However, i think at one point I had a valid reason for it,I solved that dilema. Even so although I overcame my dilema, I still would like to know if its possible.
It must be possible though, considering if in design view, you cut and paste a object it then resides above all other objects. Anyways, I'll find it with minumum effort; no sense running a long discussion about it.
The only things that you can access (no pun) for controls are the Properties that are appropriate for each (type of) control you see at Design time. The "bring to Front/Send to Back" are NOT properties defined directly against ANY (type of) control, so the ONLY way to do what you want is to do as previously suggested (i.e. set one control "invisible" and the other "visible"
Well since I'm designing a grid for a calendar I definitly need several controls to be placed in front of each other (e.g. gridlines in front of boxes) so the .visible control does not help me. I still tend to believe that it must be possible to access the Bring to front - procedure via code since I never encountered a procedure that you can do manually but not via code...however it can also be that I might not have used that many procedures :$
Thinking about this, I'm not sure there's a viable solution - the BringToFront and SendToBack are format commands used during design mode, not "run-time" operations.
If you can get them to work at all, you'd probably need to open the form in design mode, do the front-to-backing and back-to-fronting, save the design change, and reopen in form view.
Dirk - why do you need gridlines? If you make your rectangles with BORDERS, that should be all you need?
Jim Me? Ambivalent? Well, yes and no....
Another free Access forum:
I have been trying to do the same thing for over a month too. I have 3 images that overlap at the center corner. I am trying to make a 'cool' splash screen the looks that the images are spinning... I cannot use the .visible here as I want all three to be visible at all times. If ANYONE ever figures this out, let me know. There are a lot of SEND TO BACK and BRING TO FRONT applications out there. That is why VB put the Z order property in.
I have been trying to do the same thing for over a month too. I have 3 images that overlap at the center corner. I am trying to make a 'cool' splash screen the looks that the images are spinning... I cannot use the .visible here as I want all three to be visible at all times. If ANYONE ever figures this out, let me know. There are a lot of SEND TO BACK and BRING TO FRONT applications out there. That is why VB put the Z order property in.
Tuffer's situation is similar to mine. I've made a kind of photo album. It works off of linked images that you can resize, relink, and move around; however i can get them to layover each other, unless you relink the one on the bottom in place of the one on top. If i want to make a collage without adjusting the layering it wouldn't be as fun.
Here's a thought. Haven't tryed it, but it should work (may not be the best solution).
Insert a tab control on your form. Set the "BackStyle" property to "Transparent" and set the "Style" property to "None". Now, suppose you have 3 objects (pictures or whatever). Insert the 3 controls onto the 1st tab so that object A is on top of B which is on top of C. On the 2nd tab, insert object B which is on top of C which is on top A. On the 3rd tab, have C on top of A on top of B. Programatically, you can select tab 1, 2 or 3 depending on which view you want.
To place the objects on the different tabs, just select all 3 objects, press ctrl+C and then paste them onto the other tabs, then set the z order (send to back, etc)
This way may run a little slow, but won't know until you try it.
Tuffer, as far as you splash screen goes, I would create a gif file that does what I want and then insert the gif file onto my form.
Well, I'm thinking that instead of controling the layering of the objects I'll just control the field that the link resides in. Maybe I'll write something that exchanges the information in the different link fields, this would effectively put one above the other or below.. whatever the case may be.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.