Vb.net中制作网页浏览器,可以浏览网页,有程序代码更好,100分

haoztao 2004-10-29 11:34:26
功能:能浏览网页
winfrom格式得
网页里有个按钮,有个textbox,点击按钮可以获得里边内容,可以发出去即可.
可以交流msn:haoztao1@hotmail.com
问题解决可另加分
...全文
448 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
izzard 2004-11-01
  • 打赏
  • 举报
回复
Codeproject有详细的例子,去看看
cnhgj 2004-11-01
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/3245/3245208.xml?temp=.6207392
jxzhang615 2004-11-01
  • 打赏
  • 举报
回复
UP
haoztao 2004-11-01
  • 打赏
  • 举报
回复
没有解决呢,拿只能浏览网页.我想点网页中的确定按钮获取对应文本筐中的内容传给winfrom....可以再winfrom中用msgbox()show出来
haoztao 2004-10-29
  • 打赏
  • 举报
回复
顶.....最好源代码!只要vb.net得代码!c#得不要
wyy99 2004-10-29
  • 打赏
  • 举报
回复
晕,还以为是纯粹自己做
lcht1 2004-10-29
  • 打赏
  • 举报
回复
恭喜您,自己解决了
icecrystal2000 2004-10-29
  • 打赏
  • 举报
回复
简单的问题 不过我不会

帮你顶下
haoztao 2004-10-29
  • 打赏
  • 举报
回复
自己不能给自己分,郁闷
haoztao 2004-10-29
  • 打赏
  • 举报
回复
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports AxSHDocVw
'导入程序中使用到的命名空间
Public Class Form1
Inherits Form
Public Sub New ( )
MyBase.New ( )
'初始化窗体中的各个组件
InitializeComponent ( )
End Sub
'清除程序中使用的各种资源
Protected Overloads Overrides Sub Dispose ( ByVal disposing As Boolean )
If disposing Then
If Not ( components Is Nothing ) Then
components.Dispose ( )
End If
End If
MyBase.Dispose ( disposing )
End Sub
Friend WithEvents ToolBar1 As ToolBar
Friend WithEvents ToolBarButton1 As ToolBarButton
Friend WithEvents ToolBarButton2 As ToolBarButton
Friend WithEvents ToolBarButton3 As ToolBarButton
Friend WithEvents ToolBarButton4 As ToolBarButton
Friend WithEvents ToolBarButton5 As ToolBarButton
Friend WithEvents Label1 As Label
Friend WithEvents TextBox1 As TextBox
Friend WithEvents Button1 As Button
Friend WithEvents AxWebBrowser1 As AxSHDocVw.AxWebBrowser

Private components As System.ComponentModel.Container
Private Sub InitializeComponent ( )
TextBox1 = New TextBox ( )
ToolBarButton1 = New ToolBarButton ( )
ToolBarButton2 = New ToolBarButton ( )
ToolBarButton3 = New ToolBarButton ( )
ToolBarButton4 = New ToolBarButton ( )
ToolBarButton5 = New ToolBarButton ( )
Label1 = New Label ( )
ToolBar1 = New ToolBar ( )
Button1 = New Button ( )
AxWebBrowser1 = New AxSHDocVw.AxWebBrowser ( )
CType ( AxWebBrowser1 , System.ComponentModel.ISupportInitialize ).BeginInit ( )
SuspendLayout ( )
'定位"地址"文本框组件与窗体的下、左、右边框保持一致
TextBox1.Anchor = ( ( ( AnchorStyles.Top Or AnchorStyles.Bottom ) _
Or AnchorStyles.Left ) _
Or AnchorStyles.Right )
TextBox1.Location = New Point ( 48 , 40 )
TextBox1.Name = "TextBox1"
TextBox1.Size = New Size ( 296 , 21 )
TextBox1.TabIndex = 2
TextBox1.Text = ""
ToolBarButton1.Text = "向后"
ToolBarButton3.Text = "主页"
ToolBarButton2.Text = "向前"
ToolBarButton4.Text = "刷新"
ToolBarButton5.Text = "停止"

Label1.Location = New Point ( 8 , 48 )
Label1.Name = "Label1"
Label1.Size = New Size ( 48 , 23 )
Label1.TabIndex = 1
Label1.Text = "地址:"
'以下是在工具栏中加入按钮
ToolBar1.Buttons.Add ( ToolBarButton1 )
ToolBar1.Buttons.Add ( ToolBarButton2 )
ToolBar1.Buttons.Add ( ToolBarButton3 )
ToolBar1.Buttons.Add ( ToolBarButton4 )
ToolBar1.Buttons.Add ( ToolBarButton5 )
ToolBar1.DropDownArrows = True
ToolBar1.Name = "ToolBar1"
ToolBar1.ShowToolTips = True
ToolBar1.Size = New Size ( 400 , 38 )
ToolBar1.TabIndex = 0
'定位"转到"按钮组件与窗体的上、右边框保持一致
Button1.Anchor = ( AnchorStyles.Top Or AnchorStyles.Right )
Button1.Location = New Point ( 352 , 40 )
Button1.Name = "Button1"
Button1.Size = New Size ( 40 , 23 )
Button1.TabIndex = 3
Button1.Text = "转到"
'定位"浏览器"组件与窗体的上、下、左、右边框保持一致
AxWebBrowser1.Anchor = ( ( ( AnchorStyles.Top Or AnchorStyles.Bottom ) _
Or AnchorStyles.Left ) _
Or AnchorStyles.Right )
AxWebBrowser1.Enabled = True
AxWebBrowser1.Location = New Point ( 0 , 64 )
AxWebBrowser1.Size = New Size ( 400 , 240 )
AxWebBrowser1.TabIndex = 4
Me.AutoScaleBaseSize = New Size ( 6 , 14 )
Me.ClientSize = New Size ( 400 , 301 )
'在窗体上加入组件
Me.Controls.Add ( AxWebBrowser1 )
Me.Controls.Add ( Button1 )
Me.Controls.Add ( TextBox1 )
Me.Controls.Add ( Label1 )
Me.Controls.Add ( ToolBar1 )
Me.Name = "Form1"
Me.Text = "VB.NET做个性化浏览器"
CType ( Me.AxWebBrowser1 , System.ComponentModel.ISupportInitialize ).EndInit ( )
Me.ResumeLayout ( False )
End Sub
'实现浏览器的功能
Private Sub ToolBar1_ButtonClick ( ByVal sender As System.Object , ByVal e As ToolBarButtonClickEventArgs ) Handles ToolBar1.ButtonClick
'实现浏览器中的"后退"功能
If e.Button Is ToolBarButton1 Then
AxWebBrowser1.GoBack ( )
End If
'实现浏览器中的"前进"功能
If e.Button Is ToolBarButton2 Then
AxWebBrowser1.GoForward ( )
End If
'实现浏览器中的"主页"功能
If e.Button Is ToolBarButton3 Then
AxWebBrowser1.GoHome ( )
End If
'实现浏览器中的"刷新"功能
If e.Button Is ToolBarButton4 Then
AxWebBrowser1.Refresh ( )
End If
'实现浏览器中的"停止"功能
If e.Button Is ToolBarButton5 Then
AxWebBrowser1.Stop ( )
End If
End Sub
'实现"转到"按钮功能
Private Sub Button1_Click ( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles Button1.Click
Dim nullObject As System.Object = 0
Dim str As String = ""
Dim nullObjStr As System.Object = str
Cursor.Current = Cursors.WaitCursor
AxWebBrowser1.Navigate ( TextBox1.Text , nullObject , nullObjStr , nullObjStr , nullObjStr )
Cursor.Current = Cursors.Default
End Sub
End Class
Module Module1
Sub Main ( )
Application.Run ( new Form1 ( ) )
End sub
End Module
lcht1 2004-10-29
  • 打赏
  • 举报
回复
帮忙

16,555

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧