Google Answers Logo
View Question
 
Q: WebBrowser control's location on the form after window.open() How to in C# ? ( No Answer,   2 Comments )
Question  
Subject: WebBrowser control's location on the form after window.open() How to in C# ?
Category: Computers > Programming
Asked by: mikezat-ga
List Price: $32.00
Posted: 28 Jun 2004 15:30 PDT
Expires: 02 Jul 2004 12:25 PDT
Question ID: 367461
Hi!
 I have a form with embedded MS WebBrowser control. Upon clicking in
the embedded webbrowser on a link that calls JavaScript's
window.open() call where I pass different width, height, top, left and
other  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 narrowed down the problem to the Top and Left parameters being
pass in window.open().
If I set these parameters = 0, the browser positions itself nicely
within the form. If these parameters != 0 , the browser is shifted to
the right and bottom.

I figured that I can adjust the layout etc in the ClientToHostWindow()
event which seems to fire. However, I have not been able to reposition
the browser. What can I do ? If I do not fix this, I'll have to spend
months fixing all 7500+ instances of the window.open() in all web
pages.

I can email you a test form if you wish.

I am also open to the idea of taking the browser control and painting
it onto a new location. I am open to whatever works as I am pretty
desperate.




Many Thanks in Advance,

--Mike

Clarification of Question by mikezat-ga on 30 Jun 2004 09:52 PDT
If you are thinking that the question is about to be answered, I do not think
mikephoenix-ga is going to do it. The question is still opened and I
doubled the original price.

Thank you

Clarification of Question by mikezat-ga on 30 Jun 2004 12:26 PDT
<B>Please note that this technique can not be counted as the solution
as it produces noticeable blink </B>

this.webMain.Dock = System.Windows.Forms.DockStyle.None;
this.webMain.Dock = System.Windows.Forms.DockStyle.Fill;
Answer  
There is no answer at this time.

Comments  
Subject: Re: WebBrowser control's location on the form after window.open() How to in C# ?
From: mikephoenix-ga on 28 Jun 2004 23:33 PDT
 
I can definately help ya out.

A test form would REALLY be appreciated so I can get a better grasp as
to what you are trying to do.

Thanks!

Mike.
Subject: Re: WebBrowser control's location on the form after window.open() How to in C# ?
From: mikezat-ga on 29 Jun 2004 10:13 PDT
 
Hi! Thank you for taking a look. Please navigate to

http://users.adelphia.net/~mikezat/mikezat/TestApplication.zip

Inside, you'll find the entire C# solution as well as the TestPage.htm
Open the solution and change the url in the form load event to
wherever you place the html file:

private void PRSPopupForm_Load(object sender, System.EventArgs e)
{
this.Browser_Navigate(@"C:\Documents and Settings\conmxz\Desktop\TestPage.htm");
}

Please let me know when you are done, so I can delete the zip file.

Many Thanks in Advance,

--Mike

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy