.NET

Reply
Valued Contributor
yaqiz
Posts: 86
Registered: ‎07-14-2010
Message 1 of 2 (189 Views)
Accepted Solution

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

189 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*
norman.yuan
Posts: 1,014
Registered: ‎04-27-2009
Message 2 of 2 (180 Views)

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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.