OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-03-2013, 12:39
byteme67's Avatar
byteme67 byteme67 is offline
Junior Member
 
Join Date: Apr 2010
Location: Fort Misery
Posts: 25
Default ActivePage.Layers suggestions

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
Reply With Quote
  #2  
Old 08-03-2013, 09:11
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

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.
Reply With Quote
Reply

Tags
activepage, activepage.layers, layers


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -5. The time now is 21:34.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com