I
I
Ingvar Von Bjork2016-05-20 15:28:07
C++ / C#
Ingvar Von Bjork, 2016-05-20 15:28:07

How to change webBrowser height dynamically?

How to adjust the height of the webBrowser according to the content in it?
Yes, I'm aware that you can enable scrolling in it, but you don't have to -__-

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Arxont, 2016-05-20
@DeboshiR

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            this.Width = webBrowser1.Document.Body.ScrollRectangle.Width;
            this.Height = webBrowser1.Document.Body.ScrollRectangle.Height;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question