Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I want to have a piccture on a button and make it invisible and visible when another button is clicked. I have put the picture on the button by copying it and then selecting picture in the properties of the button (which is on a userform) and then ctl v. Any tips appreciated, thanks and regards, Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming the button you want to have the picture on is named CommandButton1
and the name of the "other button" is CommandButton2... then use this CommandButton2 Click event (replace my sample path to the picture with your actual path to the picture in the LoadPicture function call)... Private Sub CommandButton2_Click() If CommandButton1.Picture = 0 Then CommandButton1.Picture = LoadPicture("C:\Dir1\Dir2\Pic.bmp") Else CommandButton1.Picture = LoadPicture("") End If End Sub -- Rick (MVP - Excel) "Mark Stephens" wrote in message ... Hi, I want to have a piccture on a button and make it invisible and visible when another button is clicked. I have put the picture on the button by copying it and then selecting picture in the properties of the button (which is on a userform) and then ctl v. Any tips appreciated, thanks and regards, Mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Rick, works really well:)
Mark "Rick Rothstein" wrote in message ... Assuming the button you want to have the picture on is named CommandButton1 and the name of the "other button" is CommandButton2... then use this CommandButton2 Click event (replace my sample path to the picture with your actual path to the picture in the LoadPicture function call)... Private Sub CommandButton2_Click() If CommandButton1.Picture = 0 Then CommandButton1.Picture = LoadPicture("C:\Dir1\Dir2\Pic.bmp") Else CommandButton1.Picture = LoadPicture("") End If End Sub -- Rick (MVP - Excel) "Mark Stephens" wrote in message ... Hi, I want to have a piccture on a button and make it invisible and visible when another button is clicked. I have put the picture on the button by copying it and then selecting picture in the properties of the button (which is on a userform) and then ctl v. Any tips appreciated, thanks and regards, Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Command Button to show/hide a different worksheet | Excel Discussion (Misc queries) | |||
HOW TO HIDE/SHOW PICTURE AS PER LOGIC IS NOT DESCRIBED PROPERLY. | Excel Programming | |||
hide or show a series with a button | Charts and Charting in Excel | |||
hide and show columns using one control button | Excel Programming | |||
show and hide a picture | Excel Programming |