Scrolling problem with a WebBrowser control contained in a Panel control?

I had the same problem, also with a WebBrowser inside a Panel. Here's the solution I'm using (which I found somewhere else on stackoverflow).

I had the same problem, also with a WebBrowser inside a Panel. Here's the solution I'm using (which I found somewhere else on stackoverflow): class AutoScrollPanel : Panel { public AutoScrollPanel() { Enter += PanelNoScrollOnFocus_Enter; Leave += PanelNoScrollOnFocus_Leave; } private System.Drawing. Point scrollLocation; void PanelNoScrollOnFocus_Enter(object sender, System.

EventArgs e) { // Set the scroll location back when the control regains focus. HorizontalScroll. Value = scrollLocation.

X; VerticalScroll. Value = scrollLocation. Y; } void PanelNoScrollOnFocus_Leave(object sender, System.

EventArgs e) { // Remember the scroll location when the control loses focus. ScrollLocation. X = HorizontalScroll.

Value; scrollLocation. Y = VerticalScroll. Value; } protected override System.Drawing.

Point ScrollToControl(Control activeControl) { // When the user clicks on the webbrowser, . NET tries to scroll to // the control. Since it's the only control in the panel it will // scroll up.

This little hack prevents that. Return DisplayRectangle. Location; } }.

Try setting TabStop to false on both the containing panel as well as the WebBrowser control. That did the trick for me. The reason this works is that if it's set as a wanting to be a tabstop, it will take the first click event to mean that it's receiving focus.

This then resets the scroll bar positions... not sure why it does that... However, on navigating to a new page you'll need to manually reset the scroll bar positions... Here is what I used. Yeah it's a hack. Private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) { webBrowser1.

TabStop = true; webBrowser1.Focus(); webBrowser1. TabStop = false; }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions