Image Behind button

Mat

Well-known Member
Joined
Sep 17, 2003
Messages
509
Hi,

I have a userform with 2 buttons and an image, and some other stuff not important for my problem.

The first button show the image :

Private Sub cbSchema_Click()
frmFAQ.Height = 250
cbRetour.Visible = True
imgSchema.Visible = True
End Sub

And the second buttons hide the image :

Private Sub cbRetour_Click()
frmFAQ.Height = 188.25
imgSchema.Visible = False
cbRetour.Visible = False
End Sub


Well my button cbRetour is supposed to be OVER the image, but now it is behind, so the user can't use it to go back...

How can I specify the order of the control?

Thank you
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You can use the ZOrder property of the control.

e.g. I set up a userform with an Image named "Image1" and two commandbuttons, "CommandButton1" and "CommandButton2"

This is the code I put in each of the commandbuttons, I think this is what you wat:

Code:
Private Sub CommandButton2_Click()
  CommandButton2.ZOrder 1
  Image1.ZOrder 0
  CommandButton1.ZOrder 0
End Sub


Private Sub CommandButton1_Click()
  CommandButton2.ZOrder 0
  Image1.ZOrder 1
  CommandButton1.ZOrder 1
End Sub

If this isn't exactly what you need, just repost.
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,554
Members
449,237
Latest member
Chase S

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