如何从 wpf/windows c# 中的 Web 浏览器控件获取滚动宽度

How to get scroll width from web browser control in wpf/windows c#

我在 wpf c# 中使用 Web 浏览器控件。 我在 Web 浏览器控件中呈现 html 宽度超过 windows 宽度。 然后它显示滚动条。 所以我需要滚动宽度,或 html 正文的宽度。 如果有人有解决方案,请帮助我。 该控件可以是 windows 网络浏览器控件或 WPF 网络浏览器控件。

ScrollRectangle 将获取可滚动区域的尺寸

IEWb.Document.Body.ScrollRectangle.Height;
IEWb.Document.Body.ScrollRectangle.Width;