Color button with a drop-down color picker

Namespace: Dapfor.Net.Ui
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public class ColorButton : Button
Visual Basic
Public Class ColorButton
	Inherits Button
Visual C++
public ref class ColorButton : public Button
F#
type ColorButton =  
    class
        inherit Button
    end

Remarks

Following example demonstrates how to use color button:
 Copy imageCopy
class SomeControl : UserControl
{
    private ColorButton colorButton;

    private void InitializeComponent()
    {
        this.SuspendLayout();

        this.colorButton = new Dapfor.Net.Ui.ColorButton();
        // 
        // colorButton
        // 
        this.colorButton.BorderStyle = System.Windows.Forms.Border3DStyle.RaisedInner;
        this.colorButton.Color = System.Drawing.Color.Red;
        this.colorButton.FlatAppearance.BorderSize = 0;
        this.colorButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
        this.colorButton.Location = new System.Drawing.Point(99, 18);
        this.colorButton.Name = "colorButton";
        this.colorButton.Size = new System.Drawing.Size(53, 14);
        this.colorButton.ColorChanged += new System.EventHandler<System.EventArgs>(this.OnColorChanged);


        this.Controls.Add(this.colorButton);
        this.ResumeLayout(false);
    }

    private void OnColorChanged(object sender, EventArgs e)
    {
        //The color of the colorButton has been changed: Do something...
    }
}

Inheritance Hierarchy

Thread Safety

The control is not thread safe.

See Also