W
wavemill
Hello!
I have created a custom control, but it's not draw in my designer, but
he is draw in my application.
If you have some tutorial to create control, with category attibute and
more...
Thank you,
J.Berdoues
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace XpButton
{
public partial class CustomControl1 : Control
{
public CustomControl1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
int X = this.Width;
int Y = this.Height;
Bitmap bmpOff = new Bitmap(X, Y);
Graphics gr = Graphics.FromImage(bmpOff);
SolidBrush brush = new SolidBrush(Color.Black);
gr.FillRectangle(brush, 0, 0, X, Y);
pe.Graphics.DrawImage(bmpOff, 0, 0);
brush.Dispose();
// Calling the base class OnPaint
base.OnPaint(pe);
}
}
}
I have created a custom control, but it's not draw in my designer, but
he is draw in my application.
If you have some tutorial to create control, with category attibute and
more...
Thank you,
J.Berdoues
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace XpButton
{
public partial class CustomControl1 : Control
{
public CustomControl1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
int X = this.Width;
int Y = this.Height;
Bitmap bmpOff = new Bitmap(X, Y);
Graphics gr = Graphics.FromImage(bmpOff);
SolidBrush brush = new SolidBrush(Color.Black);
gr.FillRectangle(brush, 0, 0, X, Y);
pe.Graphics.DrawImage(bmpOff, 0, 0);
brush.Dispose();
// Calling the base class OnPaint
base.OnPaint(pe);
}
}
}