We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How do I access the Palettes that are loaded Programmatically using the PaletteGroupBar.LoadPalette()?

 

Palettes can be loaded programmatically through the PaletteGroupBar.LoadPalette(). This method returns the instance of PalettegroupView control that holds the palette. Once we have the instance of the palettegroupview control , it can be accessed easily.

This following code snippet shows the above mentioned informations.

C#

////////////////////////////////////////////////////////////////////////////////////////////////////

/ * Add the following code snippet to the DiagramBuilder Sample's MainForm_Load() event method * /

////////////////////////////////////////////////////////////////////////////////////////////////////

//Create an instance for the PaletteGroupView Class and let the instance hold the reference for the Palettefiles.

PaletteGroupView paletteGroupView = this.symbolPaletteGroupBar.LoadPalette(symbolpalettepath + "\\Basic Shapes.edp");

//Set the Back\Fore color for the Palette files of your interest by making use of this PalettegroupView object

paletteGroupView.BackColor = Color.Red;

paletteGroupView.ForeColor = Color.White;

//Set the BorderStyle and Font property of the PaletteFiles

paletteGroupView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;

paletteGroupView.Font = new Font("Arial",12f,System.Drawing.FontStyle.Bold);

//Set the HighlightItemColor property of the PaletteFiles

paletteGroupView..HighlightItemColor= Color.YellowGreen;

VB

/////////////////////////////////////////////////////////////////////////////////////////////////////

/ * Add the following code snippet to the DiagramBuilder Sample's MainForm_Load() event method * /

/////////////////////////////////////////////////////////////////////////////////////////////////////

//Create an instance for the PaletteGroupView Class and let the instance hold the reference for the Palettefiles.

Private paletteGroupView As Syncfusion.Windows.Forms.Diagram.Controls.PaletteGroupView

paletteGroupView = Me.symbolPaletteGroupBar.LoadPalette(symbolpalettepath & "\Basic Shapes.edp")

//Set the background color of the Palette files of your interest by making use of this PalettegroupView object

paletteGroupView.BackColor = System.Drawing.Color.Red

paletteGroupView.Forecolor = System.Drawing.Color.White

//Set the BorderStyle and Font property of the PaletteFiles

paletteGroupView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle

paletteGroupView.Font = New Font("Arial",12f,System.Drawing.FontStyle.Bold)

//Set the HighlightItemColor property of the PaletteFiles

paletteGroupView.HighlightItemColor= Color.YellowGreen

Article ID: Published Date: Last Revised Date: Platform: Control:
201 04/30/2011 07/10/2014 Windows Forms Diagram
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.