Windows Develop Bookmark and Share   
 index > Windows Forms General > How to autosize a WebBrowser control
 

How to autosize a WebBrowser control

HI,

Can anyone tell me that when "ScrollbarsEnabled" property of a WebBrowser control is off, how can I know the height of its document?( That i could aotusize the height of it).

Ashkan Mobayen Khiabani  Monday, September 24, 2007 12:48 AM
You can use this.webBrowser1.Document.Window.Size.Height property to get the height of the document height in the DocumentCompleted event handler function
Zhi-Xin Ye  Wednesday, September 26, 2007 11:49 AM
You can use this.webBrowser1.Document.Window.Size.Height property to get the height of the document height in the DocumentCompleted event handler function
Zhi-Xin Ye  Wednesday, September 26, 2007 11:49 AM

Hi,

i have a webbrowser control inside a form and want to set thesize of the form to thesize of the webbrowser control document (unfortunately there is no AutoSize property for a webbrowser control).

If i use this.webBrwoser.Document.Window.Size.Height in the DocumentCompleted event handler i always get the preset height of the control from the properties windows in VS 2008 Designer.

Is there something other i have to consider?

thanks

Klaus44  Thursday, September 11, 2008 8:10 AM
Did anyone ever manage to solve this problem?

thanks
K.Roberts  Tuesday, September 15, 2009 2:52 PM

You can use google to search for other answers

Custom Search

More Threads

• Unusual Button Text behaviour
• Label Font.Size
• Is there a way to resize datagridview rows
• Combo box
• disabling SHIFT + DELETE
• Identifying open windows
• Reuse ToolStripSeperator
• How to hook specific control in form using C#
• Floating tool window
• Hide a tab Page in vs 2005 is this possible?