News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Layers menu

Started by raven7, March 03, 2015, 05:40:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

raven7

Hello,

I'm looking for some Visio support. I'm sure it is the right place to ask. I need to do following 5 layers. 1 of them is background.

4 buttons showing/hiding all upper layers. The problem is that when I click one of the buttons I want all of the layers except background to be hidden and then desired one to be displayed.


Is it possible?

I'm using command buttons with following code:



Private Sub CommandButton1_Click()

Dim LayersObj As Visio.Layers
Dim LayerObj As Visio.Layer
Dim LayerName As String
Dim LayerCellObj As Visio.Cell
Set LayersObj = ActivePage.Layers
For Each LayerObj In LayersObj
LayerName = LayerObj.Name
Set LayerCellObj = LayerObj.CellsC(visLayerVisible)
If LayerName = "Metro-1" Then
' Debug.Print LayerName
If LayerCellObj.Formula = False Then

LayerCellObj.Formula = True

Else
LayerCellObj.Formula = False
End If
End If
Next

End Sub


Private Sub CommandButton2_Click()

Dim LayersObj As Visio.Layers
Dim LayerObj As Visio.Layer
Dim LayerName As String
Dim LayerCellObj As Visio.Cell
Set LayersObj = ActivePage.Layers
For Each LayerObj In LayersObj
LayerName = LayerObj.Name
Set LayerCellObj = LayerObj.CellsC(visLayerVisible)
If LayerName = "Metro-2" Then
' Debug.Print LayerName
If LayerCellObj.Formula = False Then

LayerCellObj.Formula = True

Else
LayerCellObj.Formula = False
End If
End If
Next

End Sub




[/code]

Yacine

Hi Raven,
Where is the problem? You have already all you need to fulfill the task.
Either you add a nested IF statement (if layer is background than true ELSE switch layer state), or you change your logic to a SELECT CASE loop (case background: layer = true, case THISANDTAHAT: do something else).


HTH,
Y.
Yacine

raven7

Hi,

It is working. Thanks.


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 175 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1054KB.
Tokens: post-login.
Cache hits: 13: 0.00190s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]