Control Z-index (1 Viewer)

Mod

DoCmd.PostForHelp
Local time
Today, 01:26
Joined
May 4, 2004
Messages
70
I'm using controls like textbox and rectangle to prettify my form. For example, putting a background under a control or group of controls to help the user visually seperate them.

I'm having problems making the right control appear ontop though. For example, there is a combobox on one page of my tabcontrol. Behind the combobox is a textbox, locked and set to have a red background (I'm using a textbox instead of a label because Access makes wierd flickers when the mouse passes over labels that aren't attached to controls). When the page first becomes visible, the combobox has focus and appears above the textbox like it should. When focus leaves the combobox the textbox jumps infront and hides it.

Is there anyway to stop this?

Is there a better way to improve the look and feel of VBA forms?

Thanks in advance :).
 
Last edited:

meboz

Registered User.
Local time
Today, 16:26
Joined
Aug 16, 2004
Messages
71
Try using frames to group your controls.

My suggestion for UI Design is to try and stick to the principles used by Microsoft.

Bills not a multi gozillianairre cos his UI designs are up the creek.

Keeps colors simple. A good reason in support of this is some users will be color blind and it may distract them from the task at hand or become frustrated with your 'poor' UI design, even though the colors look good by your standard.

I have read somewhere that color association is a poor approach to highligting the importance of or group control.

See how you go! :)
 

Mile-O

Back once again...
Local time
Today, 07:26
Joined
Dec 10, 2002
Messages
11,316
Do a search here for screenshots.. :)
 

Mod

DoCmd.PostForHelp
Local time
Today, 01:26
Joined
May 4, 2004
Messages
70
Good suggestions, but I was really hoping there was a way to layer controls. It seems to choose which control to put on top arbitrarily. I thought the most recently created control would be on top, and for a while that worked, but when i changed the tab order of the controls, the important active control was once again hidden by the box that is supposed to provide background color only.


As to the proper design methods, I really have no control on it. The person I'm designing this for has specified how it should look, I'm just doing my best to make that work :(


Edit:
Ah, looking at the screenshots, I see a good example of my problem. This post by Kevin S looks like what I'm trying to accomplish. I know it can be done!!! :confused:
His post w/ screenshot

See up top the grey background around that group of controls? From "Current User" in the top right to the help link in the bottom left, there is a grey box underneath everything.

When i try to make a box like this, sometimes it will cover up some of the controls. How do you just make it go underneath like he did??? :cry in frustration:
 
Last edited:

Mile-O

Back once again...
Local time
Today, 07:26
Joined
Dec 10, 2002
Messages
11,316
That just looks like a couple of rectangle controls.
 

Mod

DoCmd.PostForHelp
Local time
Today, 01:26
Joined
May 4, 2004
Messages
70
i know :( it is :(

when i create a rectangle control, it covers up other controls. how do you make it go underneath?

Edit:
Here's what I'm doing exactly, I'm probably doing something incredibly wrong.

1) Have a form with a combo box on it.
2) click the rectangle control button
3) drag the rectangle tool around the combo box.
4) release the mouse button.
**At this point, the combo box isn't covered up.**
5) right click the rectangle control
6) select fill/back color
7) click on the color i want for it (red)
** At this point, the rectangle turns red and covers up the combo box**
8) cry.
9) check to see if anyone has replied to this.
10) cry more.
11) smoke cigarrette and drink coffee.
12) check this thread again.
13) try random combinations of properties/events or anything i can think of.
14) repeat at step 1.
 
Last edited:

Mile-O

Back once again...
Local time
Today, 07:26
Joined
Dec 10, 2002
Messages
11,316
Under one of the menus (with Align, Make Same Size, etc. there's the ORDER section with Send To Back.
 

Mod

DoCmd.PostForHelp
Local time
Today, 01:26
Joined
May 4, 2004
Messages
70
Thank you for the suggestion. Maybe I'm doing it wrong, but when i try this solution, the rectangle becomes invisible (it doesn't change the visible property, just makes the control disappear). So there is no background color, even the border is gone.
 

Mile-O

Back once again...
Local time
Today, 07:26
Joined
Dec 10, 2002
Messages
11,316
That sounds more like you are trying to draw a Label (and not putting text into it) onto your form instead of a rectangle.

Or maybe you are trying to give the rectangle a Fill Color - for it to be transparent you should only mess with the BorderColor property.
 

Mod

DoCmd.PostForHelp
Local time
Today, 01:26
Joined
May 4, 2004
Messages
70
meboz said:
Bills not a multi gozillianairre cos his UI designs are up the creek.
At first this made sense to me, but I am starting to disagree. Access is whacked. :mad:

Following SJ McAbney's excellent advice, I began to experiment with the "Bring to Front" and "Send to back" menu commands.

Somehow, defying all logic, these commands are related to the tab index of a control.

I can achieve the affect I want by following these steps:
1) set focus on background rectangle.
2) select "Bring to Front" from the menu
3) set focus on the combo box
4) select "Bring to Front" from the menu

The controls appear correctly, a combo box with a red background box around it. Perfect? No, not even close, for some reason this process changes the tab index property of the combo box, so that it has the highest tab index, when i want it to have the lowest. So, changing the property in the properties form for the control is not allowed (i suppose because 0 is already taken, of course changing the tab index propert of the control with tab index 0 is also not allowed; all of the other tab indexes are also taken! and choosing an arbitrary number [-1, #of controls +1, for example] is also not allowed). So, still no problem right? Access has the handy dialog for adjusting the tab index of controls, you can just click and drag the name of the control to the appropriate location. OF COURSE IT IS NOT THAT FREAKING EASY
Using this dialog box to change the tab order sends the combo box to some layer where it is again hidden by the rectangle control.
I am no longer frustrated to the point of crying however. That emotion has been replaced by another one. Any guesses? or bumps?
 
Last edited:

Users who are viewing this thread

Top Bottom