ClientToHostWindow does not work, does it ? ( C# )

From: Mike (Mike_at_discussions.microsoft.com)
Date: 06/16/04


Date: Wed, 16 Jun 2004 11:29:25 -0700

Hi! I have a form with embedded WebBrowser. The form has a status bar on the bottom and a toolbar at the top. Upon clicking on a link in the embedded webbrowser that calls JavaScript's window.open() call where I pass different width height, top.... parameters, I open a new form of the same type as the original.

I noticed that the webbrowser in the newly opened form is shifted to the right and bottom leaving gray areas on the left and top of the form.

I figured that I can adjust the layout etc in the ClientToHostWindow() event which seems to fire. Here's what I do in the event

e.cX = this.ClientSize.Width - 3;
e.cY = this.ClientSize.Height - this.statusBar.Height - this.toolBar.Height - 3 ;

The code above does not seem to position the webbrowser control correctly. I am doing the right thing? What am I doing wrong ? What else can I do?

Many Thanks in Advance,

--Mike



Relevant Pages

  • ClientToHostWindow desperately need help, please
    ... I noticed that the webbrowser in the newly opened form is shifted to the right and bottom leaving gray areas on the left and top of the form. ... If I set these parameters = 0, the browser positions itself nicely within the form. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Control location problem on a form ( C# )
    ... I noticed that the webbrowser in the newly opened form is shifted to the right and bottom leaving gray areas on the left and top of the form. ... If I set these parameters = 0, the browser positions itself nicely within the form. ...
    (microsoft.public.dotnet.languages.csharp)
  • Control location problem on a form ( C# )
    ... I noticed that the webbrowser in the newly opened form is shifted to the right and bottom leaving gray areas on the left and top of the form. ... If I set these parameters = 0, the browser positions itself nicely within the form. ...
    (microsoft.public.dotnet.framework.windowsforms)