隐藏滚动条在WebBrowser控件 [英] Hide Scrollbars in the the webBrowser control

查看:1415
本文介绍了隐藏滚动条在WebBrowser控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Windows窗体的HTML显示控制。我使用WebBrowser控件为基准,为我的控制,我需要隐藏化网页浏览器滚动条,因为它看起来不好,永远不会被使用,使得控制样子其中遗址布局的网页。目前滚动条渲染上的控制寻找所有垂头丧气和灰色。 ?有没有办法简单地删除它一起


解决方案

有一个属性:

  webBrowser1.ScrollBarsEnabled = FALSE; 




指定WebBrowser控件是否应该有滚动条或没有。




它们可以,然而出现,如果观看网页比当前控制的大小(未在所有情况下)。



这答案允许使用鼠标的滚动但不显示滚动条浏览器?中显示了这种方法:

 无效webBrowser1_DocumentCompleted(对象发件人,
WebBrowserDocumentCompletedEventArgs五){
webBrowser1.Document.Body。风格=溢出:隐藏;
}


I am working on an HTML display control for windows forms. I am using the webBrowser control as the base for my control and I need to hide the webBrowsers scroll bar, as it looks bad, will never be used, and makes the control look like a webPage which ruins the layout. Currently the scroll bar renders on the control looking all dejected and greyed out. Is there way to simply remove it all together?

解决方案

There is a property:

webBrowser1.ScrollBarsEnabled = false;

Specifies whether the WebBrowser control should have scrollbars or not.

They "can" appear however if the viewed web page is larger than the current control's size (not in all cases).

This answer Allow scroll with mouse but don't show browser scrollbars? shows this method:

void webBrowser1_DocumentCompleted(object sender, 
                                   WebBrowserDocumentCompletedEventArgs e) {
  webBrowser1.Document.Body.Style = "overflow:hidden";
}

这篇关于隐藏滚动条在WebBrowser控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆