public BrightnessControl (ColorDialog colorDialog) { this.colorDialog = colorDialog; bitmap = new DrawingBitmap (); SuspendLayout (); BorderStyle = BorderStyle.Fixed3D; Location = new Point (0, 0); Size = new Size (14, 190); TabIndex = 0; TabStop = false; Size = new Size (14, 190); ResumeLayout (false); SetStyle (ControlStyles.DoubleBuffer, true); SetStyle (ControlStyles.AllPaintingInWmPaint, true); SetStyle (ControlStyles.UserPaint, true); }
protected override void OnPaint (PaintEventArgs e) { if (drawingBitmap == null) drawingBitmap = new DrawingBitmap (ClientSize); Draw (e); base.OnPaint (e); }