如何在Web浏览器中获取滚动条的当前垂直位置?

时间:2012-06-20 13:29:12

标签: c# .net

我可以设置滚动位置:

webCompareSQL.Document.Window.ScrollTo(0,0);

但我怎么能得到它?

2 个答案:

答案 0 :(得分:1)

以下链接与您的问题类似。

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

希望这有帮助。

答案 1 :(得分:0)

答案就在加兹提到的那一页上。

Here is the MSDN documentation on it.

为什么不......

 int top = webCompareSQL.Document.GetElementsByTagName("HTML")[0].ScrollTop;

工作?