.NET

.NET

Reply
Valued Contributor
86 Posts
1 Kudo
Registered: ‎07-14-2010
Post 1 of 2
Accepted Solution

How to set one palette on a paletteset on top through code?

194 Views, 1 Replies
04-11-2012 08:37 AM

Hi All,

 

I have a paletteset which contains multiple palettes. How can I set one of the palette on top through code?

 

It is something like set current tab in tab control

 

Any hints?

 

Thanks

 

Regards,

Yaqi

Palette contained in a PaletteSet is indexed by its order being added into the paletteSet. If you know the index of the pallete, you can call PaletteSet.Activate(index) to activate the palette, or you can loop the PaletteSet with palette name (Palette has a name when being added into PaletteSet):

 

For i As Integer=0 To myPaletteSet.Count-1

    Dim p As Palette=myPaletteSet(i)

    If  p.Name.ToUpper()="SOMENAME" THEN

        myPalleteSet.Activate(i)

        Exit For

    End If

Next

*Expert Elite*
1,084 Posts
215 Kudos
Registered: ‎04-27-2009
Post 2 of 2

Re: How to set one palette on a paletteset on top through code?

04-11-2012 10:03 AM in reply to: yaqiz

Palette contained in a PaletteSet is indexed by its order being added into the paletteSet. If you know the index of the pallete, you can call PaletteSet.Activate(index) to activate the palette, or you can loop the PaletteSet with palette name (Palette has a name when being added into PaletteSet):

 

For i As Integer=0 To myPaletteSet.Count-1

    Dim p As Palette=myPaletteSet(i)

    If  p.Name.ToUpper()="SOMENAME" THEN

        myPalleteSet.Activate(i)

        Exit For

    End If

Next

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post