Continuous Forms - Z-Order ?

liamfitz

Registered User.
Local time
Today, 05:07
Joined
May 17, 2012
Messages
240
Every time I click on a 'Text Box' ( I use it as background colour for several other controls 'in it' ), which is set under Conditional Formatting, to change colour, ( dependent on a value in one of these other Text Boxes/Controls ) It covers all of the other controls i.e changes it's Z-Order I believe. I've tried various property settings, and of course, Bring To Front and Send to Back, but to no avail alas ! Any ideas ? Thanks.
 
clicking on an object does bring it to the front, i think.

can you design the form so the text boxes do not overlap.
 
You should be able to put a transparent Label in front of it.

Chris.
 
I've now overcome it. I took the useful concept of your's ChrisO, of effectively 'reintroducing' the same object in the same place, which should restore it's original Z_Order position. ( I just 'read' the current Left and Top positions of the object in question, and then using the same co-ordinates, set them again immediately. It works ! Here's my code.
-------------------------------
Private Sub txtBGColor_Click()
Dim l, t As Long
l = Me.txtBGColor.Left
t = Me.txtBGColor.Top
Me.txtBGColor.Move Top:=t, Left:=l
Me.Requery
End Sub
-----------------------------------
P.S. I don't know whether the Requery is needed. If this helps anyone else, good news !
 
You should not need any code at all for that.

If you place a transparent ‘Masking Label’ in front of the conditional formatting Textbox then that Label should prevent the Textbox from receiving the focus. (Also turn off Tab stop for the Textbox.)

Any other active textboxes can then be placed in front of the ‘Masking Label’

So in Z order; 1 at back, 3 at front…
1. Conditional formatting Textbox.
2. ‘Masking Label’, same size as conditional formatting Textbox.
3. Any other active textboxes.

If that is not what you require then can you please post a small demo in Access 2003 format?

I will delete your entry in the Sample Database forum for the moment because it seems to ask a question rather than contain a solution.

Regards,
Chris.
 
I follow your idea, but was only aware of two Z-Order positions i.e 1 and 2. As is known, these cannot be set dynamically, only using Send To back and Bring To Front- at design time. If I can, I'd like to use your solution, but how ? Thank you again.
 
There are as many Z orders as there are controls.

attachment.php


If we have 700 controls they would be on their own Z order.
The first created is at the back and subsequently they are created on top of those already created. Some controls, like list boxes and sub-forms, have a tendency to force their way to the front and we can’t control that.

Other controls, like text boxes, will come to the front when they receive the focus. It could reasonably be said that those controls don’t really exist until they receive the focus. They could be described as ‘images of controls’ but not real controls. So, on a continuous form we appear to have many controls but the only real one is the one with the focus.

Now if we put a transparent label over a text box then that label prevents the text box from receiving the focus. A label can receive the click event but a label can not receive the focus. So the label masks the text box from receiving the focus. That text box can still be enabled and be conditionally formatted but it will not receive the focus and therefore will not come to the front.

Chris.
 

Attachments

  • Image1.PNG
    Image1.PNG
    4.4 KB · Views: 204
Thank you for your clear and logical explanation. I will be trying to implement it now.:)
 

Users who are viewing this thread

Back
Top Bottom