![]() |
#1
|
||||
|
||||
![]()
I have designed a form with 5 radio buttons. One button represents a location which in turn turns on the layer for that address location. It also turns off all other location layers. Following is the code for that user form. Question is there a shorter way to write this? And do I really have to write code for each radio button?
Code:
Private Sub btnFM_change() 'unselect all other location layers except Fort Myers With ActivePage.Layers("ft myers") .Visible = True .Printable = True .Editable = True End With With ActivePage.Layers("orlando") .Visible = False .Printable = False .Editable = False End With With ActivePage.Layers("tampa") .Visible = False .Printable = False .Editable = False End With With ActivePage.Layers("miami") .Visible = False .Printable = False .Editable = False End With With ActivePage.Layers("pt charlotte") .Visible = False .Printable = False .Editable = False End With End Sub |
#2
|
||||
|
||||
![]()
You could use a Select Case and create a separate sub that gets called on RadioButton_Change event. Put your With.ActiveLayers section in the new sub and have each one called based on the condition of your radio buttons.
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
![]() |
Tags |
activepage, activepage.layers, layers |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
layers | HeauxmBru | CorelDRAW/Corel DESIGNER VBA | 2 | 06-03-2011 21:21 |
X6 Object Model feature suggestions / requests | jemmyell | Feature requests/wishlist | 3 | 09-07-2010 06:24 |
SD suggestions | Igor | SecuriDesign | 1 | 22-04-2010 13:09 |
issue selecting shapes in ActivePage | biok | CorelDRAW/Corel DESIGNER VBA | 4 | 14-12-2009 07:37 |
layers | signweld | General | 2 | 09-03-2007 12:40 |