level 10
控件.Name
(posted via HDTB)
2011年08月08日 07点08分
2
level 6
MsgBox Command1.Name,这样没有意义的说
2011年08月08日 07点08分
3
level 1
活动的,比如 一个代码,放在按钮1里面点开就是按钮1的名字,放在按钮2里面就是按钮2 的,代码不变
2011年08月08日 07点08分
4
level 1
恩?不懂
WScript.ScriptFullName
这有一句
就像这样的,就是显示自己的名字,不是固定的
2011年08月08日 07点08分
6
level 6
饿,就是自己编写一个控件,就可以用读取自身属性表而不用加控件名
2011年08月08日 07点08分
7
level 10
貌似在 vb6 里不能做到,vb.net 就可以
(posted via HDTB)
2011年08月08日 08点08分
9
也难怪你不会用vb6.0~~弱爆了
2014年06月23日 01点06分
level 7
Dim a As Control
For Each a In Me.Controls
If a.Caption = "command1" Then msgbox a.Name
Next
2011年08月08日 08点08分
10
level 1
0.0 如果有几个command的caption都是command1呢..................
2011年08月08日 12点08分
11
level 9
做个控件,在其中加上代码Dim i As Controls = Me.hWndFor Each i In Form1.ControlsIf i.hWnd = s Then MsgBox i.NameNext
2011年08月08日 14点08分
12
level 9
Dim i As Control
s = Me.hWnd
For Each i In Form1.Controls
If i.hWnd = s Then MsgBox i.Name
Next
2011年08月08日 14点08分
13
level 9
Public Function GetName(frm As Form) As String
Dim i As Control,s As Long
s = Me.hWnd
For Each i In frm.Controls
If i.hWnd = s Then
GetName = i.Name
Exit Function
End If
Next
End Function
2011年08月08日 15点08分
14
level 14
是不是用户控件取自己的名称?
Extender.Name
Extender对象和Me对象都是返回控件当前实例的引用,前者用于在控件内部调用继承成员(不能在控件实例化事件中使用Initalize),后者用于在控件内部调用自定义成员。
用户控件的Extender对象不会弹出列表,由于它是继承vbControlExtender类实现的,所以可以写入以下代码解决:
Private Property Get Extender() As VB.vbControlExtender
Set Extender = UserControl.Extender
End Property
Extender对象如果要在控件创建时使用,可以使用以下两个事件:
InitProperties初始化属性
控件初次创建触发该事件。
ReadProperties读取属性
控件再次创建时触发,用于读取上次的属性值。
这两个事件相当于窗体的Load事件。
许多人习惯在初始化、读取和写入属性值时直接使用储存属性值的变量(简称:属性变量)。应该使用Me对象,这样既能读写属性值又能实现属性的功能。就算用变量,读写完成后又要另写代码实现属性功能,这不是多此一举吗?
还有PropertyChange方法也同样是降低控件效率的多余方法,因为控件卸载时会自动触发WriteProperties事件保存属性值。
2011年08月08日 16点08分
17
需要的就是extender,谢了
2015年01月13日 03点01分
level 1
弱弱的问一下.................怎么触发........................
2011年08月09日 00点08分
18