Button States

P

Pete

Is there a way to create button like shapes in Visio where there be an
up, over and down state to the button. It seems that if I create a
shape and make it a hyperlink to another page in the document it
doesn't act like a real button and have an over state. Is there some
sort of shape swap ability that I could apply to my shapes to make them
seem more like buttons?

Thanks.
 
J

JuneTheSecond

Mouse events might be a help.
When user down the mouse, mouse events changes the shade of button shape.
 
J

JuneTheSecond

This is my example. I used the button in Visio stencil, "Common Control".
Private WithEvents myApp As Visio.Application
Private myButton As Visio.Shape

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
InitButton
End Sub

Private Sub myApp_MouseDown(ByVal Button As Long, ByVal KeyButtonState As
Long, ByVal x As Double, ByVal y As Double, CancelDefault As Boolean)
If Button = visMouseLeft Then
If x <= myButton.Cells("PinX").Result("") +
myButton.Cells("Width").Result("") * 0.5 Then
If x >= myButton.Cells("PinX").Result("") -
myButton.Cells("Width").Result("") * 0.5 Then
If y <= myButton.Cells("PinY").Result("") +
myButton.Cells("Height").Result("") * 0.5 Then
If y >= myButton.Cells("PinY").Result("") -
myButton.Cells("Height").Result("") * 0.5 Then
myButton.Cells("User.Status") = 2
End If
End If
End If
End If
End If
End Sub

Private Sub myApp_MouseUp(ByVal Button As Long, ByVal KeyButtonState As
Long, ByVal x As Double, ByVal y As Double, CancelDefault As Boolean)
myButton.Cells("User.Status") = 0
DoEvents
End Sub

Public Sub InitButton()
Set myApp = Application
Set myButton = ActivePage.Shapes("CommandButton")
myButton.Cells("EventDrop").Formula = Empty
myButton.Cells("NoObjHandles") = True
End Sub
 
M

Mark Nelson [MS]

You can do something like this with SmartTags on the shape. The SmartTag
can appear on mouse over or be shown all the time. You can set the Action
property of the SmartTag menu item to invoke a hyperlink.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top