HighTechTalks DotNet Forums  

strange values of Document.Window.Size in WebBrowser after optical_zoom command

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss strange values of Document.Window.Size in WebBrowser after optical_zoom command in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Wolfgang
 
Posts: n/a

Default strange values of Document.Window.Size in WebBrowser after optical_zoom command - 07-10-2009 , 02:33 AM






Hi all,

i use the .net 2.0 WebBrowser with c#.
Calling the command
_axIWebBrowser2.ExecWB(
NativeMethods.OLECMDID.OLECMDID_OPTICAL_ZOOM,
NativeMethods.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROM PTUSER,
ref setZoomFactor,
ref getZoomFaktor );

where _axIWebBrowser2 is the com-object in the webbrowser.
I get it with

protected override void AttachInterfaces(object nativeActiveXObject)
{
_axIWebBrowser2 = (UnsafeNativeMethods.IWebBrowser2)nativeActiveXObj ect;
base.AttachInterfaces(nativeActiveXObject);
}

ok, so far so good, but after the execWB-command to zoom the size property
of
WebBrowser.Document.Window holds values I dont understand.

First of all, the value becomes smaler and sometimes greater.
I cant find any logic of increaseing or decreasing of the Size - property
values.

I've tried several ways to get the height e.g.

IHTMLDocument2 pDoc2 = Browser.AxIWebBrowser.Document as IHTMLDocument2;
IHTMLElement pElem = pDoc2.body;
IHTMLElement2 pBodyElem = pElem as IHTMLElement2;

int bodyWidth = pBodyElem.scrollWidth;
int bodyHeight = pBodyElem.scrollHeight;

btw.
int scrollTop = pBodyElem.scrollTop is always 0.

I need this values, because I scroll the document manually and therefore i
need the maxsize of the Document.Window.Size.

Anybody here who knows the logic of the Size value changing or knows a way
to get the correct values of the Document.Window.Size after zooming


thx in advanced

regards
Wolfgang

ps. may be this is the wrong newsgroup, if so please give me a hint which
one is the right one!

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.