A way to send a frame backward on a userform

Glory

Well-known Member
Joined
Mar 16, 2011
Messages
640
I can't get controls to appear over the top of a frame without actually inserting them into the frame. I can change the top and left properties so that the controls overlap the frame, but the frame is always in front.

Is it possible to get controls to appear in front of a frame?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hello Glory,

A Frame is a container object. By design, container objects remain in front to display the other controls they hold. I don't see why you would want an empty Frame with other objects in front of it.

Sincerely,
Leith Ross
 
Upvote 0
Because the Enter event on the text box I have inside the frame doesn't trigger when the text box takes focus from outside the frame. Only when the user tabs/clicks between controls within the frame do any Enter events attached to those controls successfully trigger.

But I like the way the frame looks on the form. So I want the textbox to overlap the frame.
 
Upvote 0
Bump.

I'm thinking I might just use an image that's a screenshot of a frame. But I'd rather not if I don't have to.
 
Upvote 0
Bump.

Edit: I was thinking about trying to make the frame transparent, but I don't see any BackStyle property for the Frame object. I'm wondering if there's a way to simulate that property.

If the frame has to be in front of the other controls, at least I could try to find a way to make it see-through.

Any clues?
 
Last edited:
Upvote 0
Toggling the BorderStyle Property seems to work for making the frame transparent.

Add a new frame to the userform and place the overlapping textbox inside the added frame. Adjust the textbox position as required and add the following code to the userform module :

The code below assumes that the newly added frame control is Frame2

Code:
Private Sub UserForm_Initialize()

    With Frame2
        .Caption = ""
        .BorderStyle = fmBorderStyleSingle
        .BorderStyle = fmBorderStyleNone
    End With
    
End Sub

You could toggle the BorderStyle Property of the frame at design time as well.
 
Upvote 0
I appreciate the effort, but I'm trying to preserve the asthetic of the frame surrounding the controls... only without the disadvantage of the event failures.

Edit: You know, I haven't actually tried running the userform with the frame overlapping the controls yet. I don't actually know for sure that it will obscure them at runtime the way it does during design time. I'll check on that.

Edit: The frame does obscure everything behind it, unfortunately.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top