Example #1
0
 public ToggleButton()
 {
     InitializeComponent();
     this.Size          = new Size(70, 35);
     _ToggleButtonStyle = new ToggleButtonStyle(this);
     //SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     SetStyle(
         ControlStyles.UserPaint |
         ControlStyles.AllPaintingInWmPaint |
         ControlStyles.OptimizedDoubleBuffer |
         ControlStyles.ResizeRedraw |
         ControlStyles.SupportsTransparentBackColor |
         ControlStyles.UserMouse |
         ControlStyles.Selectable |
         ControlStyles.StandardClick, true);
 }
 public static void SetToggleButtonStyle(ToggleButton toggleButton, ToggleButtonStyle value)
 {
     toggleButton.SetValue(ToggleButtonStyleProperty, value);
 }