Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change toggle button pic?

Status
Not open for further replies.
May 23, 2001
300
US
I have a toggle button with an embedded picture of sort ascending. What I would like to do is on click to change the picture from sort ascending to the embedded picture of sort descending.

If tglSort1 = True Then
Me.tglSort1.Picture = SortDescending
Else
Me.tglSort1.Picture = SortAscending
End If

This is what I have and obviously it doesn't work.

Thanks,

BobSchleicher
 
You could put a couple of unbound image controls on your form. One would have the SortDescending image, the other SortAscending image. Set their visible properties to False.

If tglSort1 = True Then
Me.tglSort1.Picture = Me.imgDescend.Picture
Else
Me.tglSort1.Picture = Me.imgAscend.Picture
End If

rgds
Andy
 
andylec suggestion will work out fine

If not try the button with linked images rather
than embeeded types
 
Thanks for the input. I have already thought of those options I just wanted to know how to change the picture to the another embedded picture. There has to be a way. Thanks again for your input.

BobSchleicher
 
Bob,

The trick is to put two images on your form.

For instance, I have a form which allows the user to view a different image when clicked.

Enter this code on the On Click () Event and enter it in reverse for the other image.

imgOne.Visible = True
imgTwo.Visible = False

gormcd
 
I already have it change on click. I was just looking for a way to change the embedded pic to another embedded pic in code. I figured there had to be a way and I just wanted to know if there was. Thanks for your idea.

BobSchleicher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top