Visual feedback On Selected Menu button

G

Gary

I am able to develop my own command or toolbar using VBA Code. I also added
menu buttons. How can I show visual feedback to the user that the menu
button has been selected??? I have seen visio use the square box around the
selected menu button. How can I do that???? Is there a different Face ID to
use???

Does anyone knows a reference for the various ID for different icons???

Another question is pre-selecting one of the menu button upon startup. Can
I do that by using the on open event of the document and program the desired
button to occur. The answer from about can be used to indicate its been
selected??


Thank You.
 
D

David P (Visio MVP)

Regarding button appearance, I think you probably want a toggle button, and o
see the face ids, try this in Excel

Sub ShowFaceIds()
Dim cb As CommandBar
Dim ctl As CommandBarControl
Dim x As Long
Dim i As Integer
Dim v As Variant
'Delete, recreate and show commandbar 'FaceIdList'
On Error Resume Next
Application.CommandBars("FaceIdList").Delete

On Error GoTo 0
Set cb = Application.CommandBars.Add(Name:="FaceIdList", Temporary:=True)
cb.Visible = True
cb.Position = msoBarLeft

'Add 512 buttons with different FaceIds
v = InputBox("Enter a batch number from 1 to 17", "Face IDs", "1")
If Not IsNumeric(v) Then
Exit Sub
ElseIf v < 1 Or v > 17 Then
Exit Sub
Else
i = CInt(v)
End If
For x = ((i - 1) * 500) + 1 To ((i - 1) * 500) + 500
Set ctl = cb.Controls.Add(Type:=msoControlButton, Temporary:=True)
ctl.FaceId = x
ctl.TooltipText = x
Next x

End Sub
 
G

Gary

Thank You. Before I try this, It looks like the code is go through a few
faceIDs like 512 from the Code. Was this a means for me to find a button to
toggle my menu icon with??

You are correct, I just need something that toggle (a toggle button) to
switch the icon image so my user will know that its been click or not.

How would like reference the menu button that I added to toggle it??? I can
reference the Command bar, and indicate the item in the command bar. I
assume its numbers the items from left to right and 1 is the left most menu??


Thank You Very much. Not too many people responds to this.


Gary
 

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