Use the code below. The toggle button is using the BackColor of the panel to set it's back color. But if you have a gradient it does not work. In the example below I set the panels backcolor to green , then created a gradient that uses blue and black. You will see the green background around the toggle button.
using Syncfusion.Windows.Forms.Tools;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ToggleButton
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
GradientPanel gradientPanel = new GradientPanel();
Syncfusion.Windows.Forms.Tools.ToggleButton toggleButton = new Syncfusion.Windows.Forms.Tools.ToggleButton();
gradientPanel.Height = 100;
gradientPanel.Width = 200;
gradientPanel.Location=new Point(100, 100);
gradientPanel.BackColor = Color.LightBlue;
toggleButton.Name = "toggleButton1";
toggleButton.Size = new System.Drawing.Size(100, 40);
toggleButton.Location = new Point(50, 40);
toggleButton.ThemeName = "Office2016Colorful";
gradientPanel.Border3DStyle = System.Windows.Forms.Border3DStyle.Flat;
gradientPanel.BorderColor = System.Drawing.Color.Transparent;
gradientPanel.Controls.Add(toggleButton);
this.Controls.Add(gradientPanel);
GradientPanel gradientPanel2 = new GradientPanel();
Syncfusion.Windows.Forms.Tools.ToggleButton toggleButton2 = new Syncfusion.Windows.Forms.Tools.ToggleButton();
gradientPanel2.Height = 100;
gradientPanel2.Width = 200;
gradientPanel2.Location = new Point(100, 300);
gradientPanel2.BackColor = Color.Green;
toggleButton2.Name = "toggleButton1";
toggleButton2.Size = new System.Drawing.Size(100, 40);
toggleButton2.Location = new Point(50, 20);
toggleButton2.ThemeName = "Office2016Colorful";
gradientPanel2.BackgroundColor = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, new System.Drawing.Color[] {
System.Drawing.SystemColors.HotTrack,
System.Drawing.SystemColors.WindowText,
System.Drawing.SystemColors.HotTrack});
gradientPanel2.Border3DStyle = System.Windows.Forms.Border3DStyle.Flat;
gradientPanel2.BorderColor = System.Drawing.Color.Transparent;
gradientPanel2.Controls.Add(toggleButton2);
this.Controls.Add(gradientPanel2);
}
}
}