Input for WinForms | ComponentOne
C1.Win.Input Namespace / C1CheckBox Class / CheckedIcon Property
Example

In This Topic
    CheckedIcon Property (C1CheckBox)
    In This Topic
    Gets or sets a custom C1.Framework.C1Icon for the System.Windows.Forms.CheckState.Checked checkbox state.
    Syntax
    'Declaration
     
    
    Public Property CheckedIcon As C1Icon
    public C1Icon CheckedIcon {get; set;}
    Remarks
    Use the FrontIcon key for the front icon, this key applies the ForeColor to this icon. Use the BorderIcon key for the border icon, this key applies the BorderColor to this icon. Use the BackIcon key for the back icon, this key applies the BackColor to this icon.
    Example
    public static C1Icon Checked
    {
        get
        {
            var mainIcon = new C1CompositeIcon();
            var backIcon = new C1PathIcon
            {
                ViewBox = new Rectangle(0, 0, 20, 20),
                Data = "M 4 1 C 2.5 1 1 2.5 1 4 V 16 C 1 17.5 2.5 19 4 19 H 16 C 17.5 19 19 17.5 19 16 V 4 C 19 2.5 17.5 1 16 1 H 4 Z",
                Key = "BackIcon"
            };
            var borderIcon = new C1PathIcon
            {
                ViewBox = new Rectangle(0, 0, 20, 20),
                Data = "M4 0.5C2.067 0.5 0.5 2.067 0.5 4V16C0.5 17.933 2.067 19.5 4 19.5H16C17.933 19.5 19.5 17.933 19.5 16V4C19.5 2.067 17.933 0.5 16 0.5H4Z",
                Key = "BorderIcon"
            };
            var markIcon = new C1PathIcon
            {
                ViewBox = new Rectangle(0, 0, 20, 20),
                Data = "M5.00195 10.498C5.00195 10.3613 5.05078 10.2441 5.14844 10.1465C5.24609 10.0488 5.36328 10 5.5 10C5.63672 10 5.75391 10.0488 5.85156 10.1465L8.5 12.7949L14.1484 7.14648C14.2461 7.04883 14.3633 7 14.5 7C14.5703 7 14.6348 7.01367 14.6934 7.04102C14.7559 7.06445 14.8086 7.09961 14.8516 7.14648C14.8984 7.18945 14.9355 7.24219 14.9629 7.30469C14.9902 7.36328 15.0039 7.42773 15.0039 7.49805C15.0039 7.63477 14.9531 7.75391 14.8516 7.85547L8.85156 13.8555C8.75391 13.9531 8.63672 14.002 8.5 14.002C8.36328 14.002 8.24609 13.9531 8.14844 13.8555L5.14844 10.8555C5.05078 10.7578 5.00195 10.6387 5.00195 10.498Z",
                AllowSmoothing = true,
                Key = "FrontIcon"
            };
            mainIcon.Icons.Add(borderIcon);
            mainIcon.Icons.Add(backIcon);
            mainIcon.Icons.Add(markIcon);
            mainIcon.Size = new Size(20, 20);
            return mainIcon;
        }
    }
     
        c1CheckBox.CheckedIcon = Checked;
     
        c1CheckBox.Styles.Normal.Glyph.Checked.Default.BackColor = Color.FromArgb(0, 95, 184);
        c1CheckBox.Styles.Normal.Glyph.Checked.Default.ForeColor = Color.White;
        c1CheckBox.Styles.Normal.Glyph.Checked.Default.BorderColor = Color.FromArgb(0, 95, 184);
        c1CheckBox.Styles.Normal.Glyph.Checked.Hot.BackColor = Color.FromArgb(26, 111, 191);
        c1CheckBox.Styles.Normal.Glyph.Checked.Hot.ForeColor = Color.White;
        c1CheckBox.Styles.Normal.Glyph.Checked.Hot.BorderColor = Color.FromArgb(26, 111, 191);
        c1CheckBox.Styles.Normal.Glyph.Checked.Pressed.BackColor = Color.FromArgb(51, 127, 198);
        c1CheckBox.Styles.Normal.Glyph.Checked.Pressed.ForeColor = Color.FromArgb(194, 217, 238);
        c1CheckBox.Styles.Normal.Glyph.Checked.Pressed.BorderColor = Color.FromArgb(51, 127, 198);
        c1CheckBox.Styles.Normal.Glyph.Checked.HotPressed.BackColor = Color.FromArgb(51, 127, 198);
        c1CheckBox.Styles.Normal.Glyph.Checked.HotPressed.ForeColor = Color.FromArgb(194, 217, 238);
        c1CheckBox.Styles.Normal.Glyph.Checked.HotPressed.BorderColor = Color.FromArgb(51, 127, 198);
        c1CheckBox.Styles.Normal.Glyph.Checked.Disabled.BackColor = Color.FromArgb(200, 200, 200);
        c1CheckBox.Styles.Normal.Glyph.Checked.Disabled.ForeColor = Color.FromArgb(255, 255, 255);
        c1CheckBox.Styles.Normal.Glyph.Checked.Disabled.BorderColor = Color.FromArgb(200, 200, 200);
    See Also