[RESOLVED] Assign New Property to Control
i currently have a Control Array, and need to give each control a specific name as the control i am using does not have this kind of property.
At the moment i just made a seperate String Array which holds the values that i want for each control.
Is it possible to assign a new property to a control so that it may be like this?
Code:
Winsock1(1).Username
(Username is not a current property of Winsock1 control)
This would make my project run a lot smoother. Any help would be greatly appreciated thank you :)
Re: Assign New Property to Control
Here is one way where you can use Collections to hold the information:
Code:
Option Explicit
Dim Username As Collection
Private Sub Command1_Click()
MsgBox Username(Winsock1.Name)
End Sub
Private Sub Form_Load()
Set Username = New Collection
Username.Add "Matthew", Winsock1.Name
End Sub
Not exactly what you want, but something like it. You can use the Index as well:
Code:
Option Explicit
Dim Username As Collection
Private Sub Command1_Click()
MsgBox Username(CStr(Winsock1(0).Index))
End Sub
Private Sub Form_Load()
Set Username = New Collection
Username.Add "Matthew", CStr(Winsock1(0).Index)
End Sub
Or you can use the Tag property, place some individual index number and then use that. However remember Tag stores information as a String and Collections make difference with a numeric and string indexes.
Re: Assign New Property to Control
thank you very much Merri!
it was just the answer i was looking for :)