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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: WinForms |
Control: Diagram |
Published Date: April 30, 2011 |
Last Revised Date: June 4, 2019

Load palettes programmatically

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

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon