Posted 16 January 2024, 4:06 pm EST
Hi Duyet,
You can add this code to the form.designer.cs, but we do not recommend manually changing the form.designer.cs code.
Instead, we suggest adding this code to the form.cs (in the constructor or during the form load). If you include this code in the form.cs, just make sure to clear the current IconSet of your RibbonColorPicker before adding the new Icon. Please see the following code from our sample project:
var pathIcon = new C1PathIcon
{
AllowSmoothing = false,
Color = ribbonColorPicker1.Color,
Data = "M-2.7755575615628892e-17,18.89795939167988 h24 v5.142857098579968 h-24 z",
Size = new Size(16, 16),
Stroke = Color.Empty,
ViewBox = new Rectangle(0, 0, 24, 24)
};
var bucketIcon = new C1BitmapIcon("FillTool", new Size(16, 16), Color.Transparent, "Preset_SmallImages", 150);
C1CompositeIcon fillIcon = new C1CompositeIcon { Size = new Size(16, 16) };
fillIcon.Icons.Add(bucketIcon);
fillIcon.Icons.Add(pathIcon);
ribbonColorPicker1.IconSet.Clear(); //clear the current IconSet
ribbonColorPicker1.IconSet.Add(fillIcon);
The Data property of the C1PathIcon stores an SVG path string describing the shape. Here is a reference link explaining the SVG path string - https://www.w3schools.com/graphics/svg_path.asp
If you still face any issues, please provide a sample project showing your implementation, so we can investigate further and assist you better.
Best Regards,
Kartik