astadtla / csexwb2

Automatically exported from code.google.com/p/csexwb2
0 stars 0 forks source link

cant get the right size of the document after zoom #83

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. build a form with the cexwb init
2. zoom via browser.SetOpticalZoomValue(prozent);
3. get the size of the document
                IHTMLDocument2 pDoc2 = 
WebBrowser.WebbrowserObject.Document as IHTMLDocument2;
                IHTMLDocument3 pDoc3 = 
WebBrowser.WebbrowserObject.Document as IHTMLDocument3;

                IHTMLElement pElem = pDoc2.body;
                IHTMLElement2 pBodyElem = pElem as 
IHTMLElement2;

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

                pElem = pDoc3.documentElement;
                pBodyElem = pElem as IHTMLElement2;
                int rootHeight = pBodyElem.scrollHeight;
                int rootWidth = pBodyElem.scrollWidth;

                int width = rootWidth > bodyWidth ? 
rootWidth : bodyWidth;
                int height = rootHeight > bodyHeight ? 
rootHeight : bodyHeight;

                Size size = new Size(width, height);
                return size;

after zooming the size.Height property is constant

Backgraound is, I need the scroll properties becouse I must manually 
scroll the webbrowser.

I'm using Vista, ie8, VS2008

regards 

Wolfgang

Original issue reported on code.google.com by wolfgang...@sybersoft.de on 11 Sep 2009 at 2:53