1234567891011121314151617181920212223242526272829303132333435 |
- using System.Drawing;
- using System.Windows.Forms;
- namespace PaintDotNet
- {
- internal class ColorRectangleControl : UserControl
- {
- private Color rectangleColor;
- public Color RectangleColor
- {
- get
- {
- return rectangleColor;
- }
- set
- {
- rectangleColor = value;
- Invalidate(true);
- }
- }
- public ColorRectangleControl()
- {
- this.ResizeRedraw = true;
- this.DoubleBuffered = true;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- Utility.DrawColorRectangle(e.Graphics, this.ClientRectangle, rectangleColor, true);
- base.OnPaint(e);
- }
- }
- }
|