How to retrieve the scrollbar position of the webbrowser control in .NET

前端 未结 7 1814
刺人心
刺人心 2020-12-11 18:44

I tried using webBrowser1.Document.Body.ScrollTop and webBrowser1.Document.Body.ScrollLeft, but they don\'t work. They always return 0 and I can\'t

7条回答
  •  隐瞒了意图╮
    2020-12-11 19:21

    I was able to query the scroll position using this

            if (this.webBrowser.Document != null)
            {
                int scrollPosition = this webBrowser.Document.Body.ScrollTop;                
            }
    

提交回复
热议问题