控件:WebBrowser,TreeView
注意:修改WebBrowser的Anchor属性 TreeView的各个结点,以及结点的内容需要事先加入
代码:
- Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
- Select Case e.Node.Text
- Case "Visual Basic Forums"
- WebBrowser1.Navigate("http://go.microsoft.com/" _
- & "fwlink/?LinkID=82999")
- Case "Visual Basic Express Edition"
- WebBrowser1.Navigate("http://go.microsoft.com/" _
- & "fwlink/?LinkID=82994")
- Case "Visual Basic IDE"
- WebBrowser1.Navigate("http://go.microsoft.com/" _
- & "fwlink/?LinkID=82996")
- Case "Visual Basic Language"
- WebBrowser1.Navigate("http://go.microsoft.com/" _
- & "fwlink/?LinkID=82997")
- Case "襄樊学院"
- WebBrowser1.Navigate("http://www.xfu.edu.cn")
- Case "网易"
- WebBrowser1.Navigate("http://www.163.com")
- Case "百度"
- WebBrowser1.Navigate("http://www.baidu.com")
- Case "好123"
- WebBrowser1.Navigate("http://www.hao123.com")
- End Select
- End Sub
在标题栏加一个动态的时钟显示:
控件:timer 设置它的interval=1000
代码:
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- Me.Text = "巍威提示你,现在时间:" + Now.ToString
- '或 Me.Text = "巍威提示你,现在时间:" + cstr(Now)
- End Sub