hahaha,
Thx for the offer man. Any way try out the solution i gave you. It works
fine in my machine, with just 2 lines of code.
//attaching the previous post
I added two lines of code (dirty way ofcourse) to get the layout properly in
the 2nd case. Replace this function in the sample you gave to me. It works
private void OnDocumentComplete(object pDisp, ref object URL)
{
//Debug.WriteLine("OnDocumentComplete");
try
{
// TODO parse the string and get rid off server
HTMLDocument myDoc =(HTMLDocument) this.webMain.Document;
if(null!=myDoc)
{
string pageTitle = myDoc.title.Trim();
if (pageTitle != string.Empty)
{
this.Text =
pageTitle.Substring(pageTitle.IndexOf("-")+ 1);
}
else
{
this.Text = myDoc.url;
}
}
}
catch
{
this.Text = "PRS";
}
//ADD THESE 2 LINES OF CODE
this.webMain.Dock = System.Windows.Forms.DockStyle.None;
this.webMain.Dock = System.Windows.Forms.DockStyle.Fill;
}
--
Shak
(Houston)
"Mike" <(E-Mail Removed)> wrote in message
news:A198918A-DE45-43F5-9663-(E-Mail Removed)...
> Free pizza if you solve the problem!
>
> "Shakir Hussain" wrote:
>
> > Mike,
> >
> > I am investigating your code and able to see your problem. Give me some
> > time. Will bring up a solution hopefully.
> >
> > --
> > Shak
> > (Houston)
> >
> >
> > "Mike" <(E-Mail Removed)> wrote in message
> > news:F2B46CFF-3EDB-43A9-BAF5-(E-Mail Removed)...
> > > Hi! Thank you for taking a look. Please navigate to
> > >
> > > http://users.adelphia.net/~mikezat/m...pplication.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");
> > > }
> > >
> > > The test page contains 2 links. 1 is the one that calls window.open()
> > without specifying the Left and Top. As you can see, it works great.
> > > The second is the one giving me all the problem in the world. I am
pretty
> > desperate as the alternative is to modify almost 8000 pages.
> > >
> > > "Shakir Hussain" wrote:
> > >
> > > > Mike,
> > > >
> > > > can you paste the code where you create a new form (after clicking
link)
> > and
> > > > adding browser control?
> > > >
> > > > It will help me to investigate. I believe this problem can be fixed.
> > > >
> > > > Shak
> > > > (Houston)
> > > >
> > > >
> > > > "Mike" <(E-Mail Removed)> wrote in message
> > > > news:ACF00E8B-2BE0-4050-8906-(E-Mail Removed)...
> > > > > Hi! I posted this question in browser_ctl group as well but got no
> > > > results.
> > > > >
> > > > > I have a form with embedded WebBrowser. Upon clicking on a link
in
> > the
> > > > embedded webbrowser 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
> > the
> > > > call to 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.
Any
> > > > samples on how to do it, please?
> > > > > I am not that great of a C# programmer, so may be somebody can
show me
> > > > > how to adjust the position of webbrowser within the form, please.
> > > > >
> > > > > 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
> > > > >
> > > > >
> > > > >
> > > > > Expand AllCollapse All
> > > >
> > > >
> > > >
> >
> >
> >