Image Behind button :: MrExcel Message Board



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Image Behind button
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Mat
Board Master


Joined: 17 Sep 2003
Posts: 451
Location: Montréal, Québec
Flag: Canada

Status: Offline

 Reply with quote  

Image Behind button

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

Post Fri Sep 19, 2003 8:45 pm 
 View user's profile Send private message

Mark O'Brien
MrExcel MVP


Joined: 16 Feb 2002
Posts: 3171
Location: Columbus, OH, USA
Flag: Scotland

Status: Offline

 Reply with quote  

Re: Image Behind button

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.
_________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club

Post Sat Sep 20, 2003 10:28 pm 
 View user's profile Send private message

Mat
Board Master


Joined: 17 Sep 2003
Posts: 451
Location: Montréal, Québec
Flag: Canada

Status: Offline

 Reply with quote  

Re: Image Behind button

Thank you Mark,

That's exactly what I needed!

Mat

Post Mon Sep 22, 2003 1:26 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.