A
abhimanyu
Hi,
I have an application written in C# that displays web page using the
System.Windows.Forms.WebBrowser control. I have overridden the
MouseDown method of this control and on mouse down I get the Html
element underneath the cursor and display its properties.
The problem is that when an element is clicked, I want to display a
border around the element for which I thought I will override the
OnPaint method and draw the border using element's coordinates.
Firstly the OnPaint was not being called, then I set the style to
UserPaint using
this.SetStyle(ControlStyles.UserPaint, true);
I now get the OnPaint call but whatever I draw is not visible on the
browser.
base.OnPaint(e);
if (_mouseDown)
{
e.Graphics.FillRectangle(Brushes.Blue, 0, 0, 100,
100);
_mouseDown = false;
}
I also tried overriding the WndProc and when the message is WM_PAINT I
draw using the Graphics object that I get using this.CreateGraphics()
but it didnt work either.
Any ideas??
I have an application written in C# that displays web page using the
System.Windows.Forms.WebBrowser control. I have overridden the
MouseDown method of this control and on mouse down I get the Html
element underneath the cursor and display its properties.
The problem is that when an element is clicked, I want to display a
border around the element for which I thought I will override the
OnPaint method and draw the border using element's coordinates.
Firstly the OnPaint was not being called, then I set the style to
UserPaint using
this.SetStyle(ControlStyles.UserPaint, true);
I now get the OnPaint call but whatever I draw is not visible on the
browser.
base.OnPaint(e);
if (_mouseDown)
{
e.Graphics.FillRectangle(Brushes.Blue, 0, 0, 100,
100);
_mouseDown = false;
}
I also tried overriding the WndProc and when the message is WM_PAINT I
draw using the Graphics object that I get using this.CreateGraphics()
but it didnt work either.
Any ideas??