社区
C#
帖子详情
webbrowser控件如何禁用滚动条呢?
xiaohefeng
2003-07-08 12:24:12
显示网页时总有滚动条,想把它隐藏掉。
谢谢。
...全文
662
3
打赏
收藏
webbrowser控件如何禁用滚动条呢?
显示网页时总有滚动条,想把它隐藏掉。 谢谢。
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
孟子E章
2003-07-08
打赏
举报
回复
关键:
private void axWebBrowser1_DownloadComplete(object sender, System.EventArgs e)
{
IHTMLDocument2 HTMLDocument =(IHTMLDocument2) axWebBrowser1.Document;
HTMLDocument.body.style.overflow = "hidden";
}
孟子E章
2003-07-08
打赏
举报
回复
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using mshtml;
namespace WebBrowser
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private AxSHDocVw.AxWebBrowser axWebBrowser1;
private System.Windows.Forms.TextBox textBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.axWebBrowser1 = new AxSHDocVw.AxWebBrowser();
this.textBox1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).BeginInit();
this.SuspendLayout();
//
// axWebBrowser1
//
this.axWebBrowser1.Enabled = true;
this.axWebBrowser1.Location = new System.Drawing.Point(64, 40);
this.axWebBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWebBrowser1.OcxState")));
this.axWebBrowser1.Size = new System.Drawing.Size(300, 150);
this.axWebBrowser1.TabIndex = 4;
this.axWebBrowser1.DownloadComplete += new System.EventHandler(this.axWebBrowser1_DownloadComplete);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(80, 216);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 5;
this.textBox1.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(528, 373);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox1,
this.axWebBrowser1});
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
object Zero = 0;
object EmptyString = "";
axWebBrowser1.Navigate("http://xml.sz.luohuedu.net/xml/Content.asp",ref Zero, ref EmptyString, ref EmptyString, ref EmptyString);
}
private void axWebBrowser1_DownloadComplete(object sender, System.EventArgs e)
{
IHTMLDocument2 HTMLDocument =(IHTMLDocument2) axWebBrowser1.Document;
HTMLDocument.body.style.overflow = "hidden";
this.textBox1.Text = "ok";
}
}
}
xiaohefeng
2003-07-08
打赏
举报
回复
多谢。
我现在的水平根本想不到这一步,有点自卑。哈哈。
C# 用VScrollBar控制
web
browser
的
滚动条
简单测试
在本文中,我们将深入探讨如何在C#编程环境中使用VScrollBar
控件
来控制
Web
Browser
控件
的
滚动条
,尤其在触摸屏设备上提供更友好的用户体验。在触摸屏设备上,由于
Web
Browser
控件
自带的垂直
滚动条
可能过于细小,用户...
web
browser
滚动条
位置
在某些应用场景下,我们可能需要获取或设置
Web
Browser
控件
的
滚动条
位置,例如在实现自动化测试、页面导航或者特定交互效果时。本篇文章将详细介绍如何在C#中获取和设置
Web
Browser
控件
的
滚动条
位置。 首先,我们需要...
去掉
Web
Browser
的边框和
滚动条
本篇文章将详细探讨如何通过编程手段去除
Web
Browser
控件
的边框和
滚动条
,使它更加融入到应用程序的界面设计中。 首先,我们要理解
Web
Browser
控件
的特性。它是.NET Framework提供的一种
控件
,用于在桌面应用中展示...
MFC
Web
Browser
控件
加载HTMLVC++源码
MFC
Web
Browser
控件
加载HTMLVC++源码,
Web
Browser
控件
加载HTML网页时不显示
滚动条
,实现事件 documentcomplete,当HTML下载完毕时再显示出来,然后在此事件代码中去掉
滚动条
。.zip
vb6_
Web
browser
控件
使用技巧
### vb6_
Web
browser
控件
使用技巧 #### 一、获得浏览器信息 在Visual Basic 6.0中,可以通过
Web
browser
控件
获取浏览器的相关信息。具体实现方式如下: 1. **加载网页**: ```vb Private Sub Command1_Click() ...
C#
111,096
社区成员
642,554
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章