关于代码-来自bluemania [英] about code - from bluemania

查看:74
本文介绍了关于代码-来自bluemania的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了这个新的Web浏览器第一个vb项目.我有六个按钮
& ProgressBar进度条不起作用,但Web浏览器工作正常
这是一些我无法弄清楚的代码.

i made this new web browser first vb project ever. i''ve got six buttons
& ProgressBar the progressbar doesnt work but the webbrowser works fine
here is some code i cant figure it out.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Navigate(TextBox1.Text)
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser1.GoBack()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        WebBrowser1.GoForward()
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        WebBrowser1.Stop()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        WebBrowser1.Refresh()
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        WebBrowser1.GoHome()
    End Sub

    Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


    End Sub



任何帮助将不胜感激,谢谢您::suss:



Any help would be much appreciated thank''s :suss:

推荐答案

首先,您应该使用有意义的名称来命名您的对象-Button1在您使用时不会告诉您任何内容正在阅读代码,而btnGo或btnForward等告诉您一些信息.

您的进度条不起作用,因为您没有在任何地方进行更新...通常,进度条没有Click事件,您可以在代码进行过程中对其进行更新,以向用户指示事情正在发生. ..
First of all, you should really name your objects with meaningful names - Button1 tells you nothing when you are reading through the code, whereas btnGo or btnForward etc tells you something.

Your progress bar isn''t working because you aren''t updating it anywhere... Generally a progress bar doesn''t have a Click event, you update it as your code progresses to indicate to the user that things are happening...


这篇关于关于代码-来自bluemania的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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