Hey,
I am trying to subclass a button to create a control similar to the
Firefox/IE dropdown button. My first step is to draw the 'down arrow'
on the button. I overrided the OnPaint method thusly:
protected override void OnPaintBackground(PaintEventArgs pevent)
{
base.OnPaintBackground(pevent);
paintArrow();
}
void paintArrow()
{
Graphics G = CreateGraphics();
Bitmap b = LibXIE.img.DownArrow;
//Draw the down arrow centered and to the right
Point arrowPoint = new Point(
Width - b.Width - padding,
Height / 2 - b.Height / 2);
G.DrawImageUnscaled(b, arrowPoint);
}
However, the arrow only shows up when I resize the borders of the
button (in the form designer). When the button is drawn the paintArrow
event is called (I can add debugging and see it being called), but the
arrow does not show up.
Are there other methods I have to override? Or am I doing something
wrong?
Thanks,
Nathan