Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I have three gif-objects (three smilies, one green, one yellow, one red) which build a traffic light. Depending on the user interaction, I want to display only one of the three smilies. Does anybody know, how I can handle this problem. Is it possible to control gifs with VB, I mean control their state (displayed/ not displayed) or is there something like a canvas, which can contain a gif? Thanks a lot for your answers. Regards Christian |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Christian,
Christian Galbavy wrote: I have three gif-objects (three smilies, one green, one yellow, one red) which build a traffic light. Depending on the user interaction, I want to display only one of the three smilies. Does anybody know, how I can handle this problem. Is it possible to control gifs with VB, I mean control their state (displayed/ not displayed) or is there something like a canvas, which can contain a gif? Are you referring to GIFs on a worksheet? If so, you can use the Shapes collection to get at the images via VBA. Here's the setup: 1) Insert each GIF using Insert | Picture -- From File... 2) Name them picGreen, picYellow, and picRed (after selecting one, you can use the Name box in the toolbar to rename it) Now, you can show/hide them as follows: Public Enum eLightColor Green = 1 Yellow = 2 Red = 3 End Enum Public Sub gChangeLight(rlColor As eLightColor) With Sheets("Sheet1") If rlColor = eLightColor.Green Then .Shapes("picGreen").Visible = msoTrue .Shapes("picYellow").Visible = msoFalse .Shapes("picRed").Visible = msoFalse ElseIf rlColor = eLightColor.Yellow Then .Shapes("picGreen").Visible = msoFalse .Shapes("picYellow").Visible = msoTrue .Shapes("picRed").Visible = msoFalse Else .Shapes("picGreen").Visible = msoFalse .Shapes("picYellow").Visible = msoFalse .Shapes("picRed").Visible = msoTrue End If End With End Sub '/ make the light green gChangeLight eLightColor.Green -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Process control chart for quality control in exel? | Charts and Charting in Excel | |||
2007 Form Control/ActiveX Control font difference | Excel Discussion (Misc queries) | |||
Difference between a Forms Control verus Active-X Control | Excel Discussion (Misc queries) | |||
Tool Tip Text for Form control/ Active-X control | Excel Programming | |||
Calendar Control: Can't exit design mode because control can't be created | Excel Programming |