Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Ha

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

End Sub
End Class

================
今天刚装了VB2010,我新建一个form,然后创建一个按钮,双击按钮进入代码界面。
可是为什么会有这么多乱七八糟的东西?这些都是什么

VB 6.0的话,双击按钮之后应该只有
sub command1_click()
end sub

为什么2010会多出这么多东西,能不能帮我解释 下每句的意思。我知道2010是。net,我只是要知道每句的意思,说“这是net语言,跟6.0完全不一样”,然后就没下文的就洗洗睡吧·

呵呵 VB.net和6.0是两种不同的设计思路,某种意义上说他们是两种不同的语言都不为过,.net是面向对象的,而6.0是面向事件的
而楼主新建按钮多出来的那些代码正反映了这个本质,Handles Button1.Click是将该动作绑定到Button1这个按钮上面的意思,ByVal sender As System.Object, ByVal e As System.EventArgs这两个参数是当用户单击该按钮是,向该单击事件传递事件环境,比如鼠标指针的位置等等(即e参数)
-------------------------The End
温馨提示:内容为网友见解,仅供参考
无其他回答

vb.net 中单击button一次是一个事件再次点击又是另一个事件的代码是_百...
Dim i As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click i = i + 1 If i = 1 Then MsgBox("我是代码一") ElseIf i = 2 Then MsgBox("我是代码二" & Now) Else MsgBox("我是其他"...

VB.NET怎么编模拟袖珍计算器的完整程序?
Public C护激篙刻蕻灸戈熏恭抹lass Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim c As Char c = Trim(TextBox3.Text)Select Case c Case "+"TextBox4.Text = Val(TextBox1.Text) + Val(TextBox2.Text)Cas...

vb.net程序,利用随机函数产生100个1到100之间的整数,求其中的最大最小...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Randomize() '产生随机数种子 以防止每次生成结果都一样 Dim a(100) As Integer '声明数组存放数据 用来保存随机数结果 Dim max As Integer, min As Integer '声明两个变量存...

VB猜数字游戏源代码?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Me.Button1.Text = "开始" Then Dim a As Integer = MsgBox("游戏开始你准备好了吗", MsgBoxStyle.YesNo, "提示!")If a = 6 Then js = 1 Me.Button1.Text = "确...

...as system.object,byvaleassystem.eventargs)handles buttON1.CL...
1. 定义一个方法,button1_click(byvalsenderas system.object,byvaleassystem.eventargs) 包括返回值和输入参数,英文叫 Event Handler。2. 同时把该方法绑定在 buttON1.CLICK 事件上。另外 在VB.net 里事件定义是用关键字 Event 比如:Public Event SalarySecurityEvent(ByVal Sender As EmployeeWith...

VB通过文本框输入个人的姓名、通过单选按钮组输入性别和政治面貌,通 ...
Private Sub Button1_Click(ByVa l sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim aihao As String, Sex As String, zhengzhi As String aihao = "爱好:"Sex = "性别:"zhengzhi = "政治面貌:"If CheckBox1.Checked = True Then aihao = aihao + ...

这段vb代码怎么一直错的..急用啊
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cn As New SqlConnection("Initial Catalog=图书信息管理;data source=(local)")cn.open Dim sql As String = "select * from book where ???='" & textbook1.text &"'"...

求VB大神解决
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click, Button6.Click Select Case sender.name Case "Button1"Label2.Text = Button1.Text & "函数的结果"TextBox2....

vb.net中,在程序运行,用户未操作时,使文本框textbox1获取焦点的代码是什...
Public Class Form3 按下,显示控件,并获得焦点.Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Visible = True TextBox1.Focus()End Sub 判断是否获得焦点.Private Sub Button2_Click(ByVal sender As System.Object, By...

vb.net中,不使用FSO方法,怎么快速的得到文件夹的大小?
窗体上添加一个按钮,代码如下:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Button1.Text = "稍等!"Button1.Enabled = False Dim MyFolder As String = "C:\\Windows"Dim MyDir As New System.IO....

相似回答