在VB中,Me的用法!
1个回答
展开全部
Me是代表所处窗体本身,例:
VBScript
code
Private
Sub
Command1_Click()
ChangeFormColor
Me
End
Sub
Sub
ChangeFormColor(FormName
As
Form)
FormName.BackColor
=
RGB(Rnd
*
256,
Rnd
*
256,
Rnd
*
256)
End
Sub
Private
Sub
Command2_Click()
Me.Command1.Caption
=
"演示Me含义"
End
Sub
Me.Command1.Caption
=
"演示Me含义"
等效于
Form1.Command2.Caption
=
"演示Me含义"
在VB.Net中
ME就类似于C++
C#的this指针
VBScript
code
Private
Sub
Command1_Click()
ChangeFormColor
Me
End
Sub
Sub
ChangeFormColor(FormName
As
Form)
FormName.BackColor
=
RGB(Rnd
*
256,
Rnd
*
256,
Rnd
*
256)
End
Sub
Private
Sub
Command2_Click()
Me.Command1.Caption
=
"演示Me含义"
End
Sub
Me.Command1.Caption
=
"演示Me含义"
等效于
Form1.Command2.Caption
=
"演示Me含义"
在VB.Net中
ME就类似于C++
C#的this指针
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询