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

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

Anonymous
Not applicable
1,061 Views
1 Reply
Message 1 of 2

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

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
1,062 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor
Accepted solution

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

Norman Yuan

Drive CAD With Code

EESignature

0 Likes