типа
- Код: Выделить всё
K=RetKey("vbKeyLeft")
Function RetKey(K as string)
RetKey=...
End Function
K=RetKey("vbKeyLeft")
Function RetKey(K as string)
RetKey=...
End Function
Sub prepareButton()
Me.Command1.Tag = 37
Me.Command2.Tag = 38
Me.Command3.Tag = 39
'...
Me.CommandN.Tag = X
End Sub
Function GetK(byref objCommand as CommandButton) as KeyCodeConstants
GetK = objCommand.Tag
End Sub
Option Explicit
Private Sub Form_Load()
GenerateCollectionCode "myCol", Text1
End Sub
Private Sub GenerateCollectionCode(ByVal CollectionName As String, ByVal DumpTo As TextBox)
Dim t As New TLI.TLIApplication
Dim i As Long, s As String
With t.TypeLibInfoFromFile("MSVBVM60.DLL\3").Constants.NamedItem("KeyCodeConstants")
For i = 1 To .Members.Count
s = s & CollectionName & ".add " & .Members(i).Name & ", """ & .Members(i).Name & """" & vbNewLine
Next
End With
DumpTo.Text = s
Set t = Nothing
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 156