Hello,

I am working on an enhanced HTML-Editor based on DHTMLEdit. So I created a
subclass like that:

public class HTMLEditor : AxDHTMLEDLib.AxDHTMLEdit

I have created a lot of functions to insert Tables, Images, etc. Edit them,
drag Table cells, etc... What I now basically want is to draw my own stuff
in the editing window on top of that which is drawn anyway by DHTMLEdit.

For example a grid like Visual Studio .NET does in HTML-View. Or drawing
boxes over tables which the mouse is hovering like Frontpage 2003 does...

I thought I simple override WndProc, catch WM_PAINT, let the base class do
that drawing stuff and then I just paint my stuff over it, like that:

protected override void WndProc(ref System.Windows.Forms.Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_PAINT)
{
IntPtr hDC = IntPtr.Zero;
hDC = GetDC(this.Handle);
Graphics g = Graphics.FromHdc(hDC);

g.FillRectangle(new SolidBrush(Color.Red),0,0,100,100);

g.Dispose();
ReleaseDC(this.Handle, hDC);
}
}

I tried other things to get an instance of Graphics, like
CreateGraphics-Member of Control, etc.

When starting the app, I see that red rectangle, but a second later it's
"hidden" by the HTMLEditor, and its never visible again.

I also played around with the ControlStyles, but did not find anything that
worked...

Anyone has an idea?

Thanks in advance,
Phillip Schuster