原创 vb调用Webbrowser技巧集3收藏

1、页面滚动:


Private Sub Command2_Click()
    WebBrowser1.Document.parentwindow.scrollby 0, 30
End Sub

Private Sub Form_Load()
     WebBrowser1.Navigate "http://www.applevb.com"
End Sub

点击Command2就可以使当前页面向下滚动30像素

2、判断页面是否可以前进后退

Private Sub Command1_Click()
    WebBrowser1.GoForward
End Sub

Private Sub Command2_Click()
    WebBrowser1.GoBack
End Sub

Private Sub Form_Load()
    WebBrowser1.Navigate "http://www.applevb.com"
End Sub

Private Sub WebBrowser1_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
    If (Command = CSC_NAVIGATEBACK) Then
        Command2.Enabled = Enable
    End If
    If (Command = CSC_NAVIGATEFORWARD) Then
        Command1.Enabled = Enable
    End If
End Sub

上面的command1是前进按钮,command2是后退按钮。

发表于 @ 2004年07月29日 23:49:00|评论(loading...)

新一篇: VB调用webbrowser技巧集4 | 旧一篇: VB调用webbrowser技巧集2

用户操作
[即时聊天] [发私信] [加为好友]
陈锐
订阅我的博客
XML聚合  FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
文章分类
收藏
    Graphics File Formats FAQ
    Adding Custom Buttons to Internet Explorer
    Creating a Windows DLL with Visual Basic
    Graphics File Formats FAQ (Part 1 of 4): General Graphics Format Questions
    Graphics File Formats FAQ (Part 2 of 4): Image Conversion and Display Programs
    Graphics File Formats FAQ (Part 3 of 4): Where to Get File Format Specifications
    Graphics File Formats FAQ (Part 4 of 4): Tips and Tricks of the Trade
    Visual Basic乱七八糟
    朋友的Blog
    小雨的Blog(RSS)
    瓜少之胡言乱语(RSS)
    美女苏胖墩的BLOG
    莫依的博客
    道士摄影
    马宁的Blog(RSS)
    我得主页
    AppleVB
    一些杂七杂八的东西
    40个常用的JS
    存档
    软件项目交易
    Csdn Blog version 3.1a
    Copyright © 陈锐