December 12th, 2012, 04:07 AM
[RESOLVED] [VB6]About properties...
I've another question for you whereas nobody could help me.
First of all, I'd like to know how you would do to pass a param of a property of one class to another class. I'll explain better:
I've two class modules (clsGame and clsSound). In clsGame I have this code:
while in clsSound
Dim m_Sound As New clsSound
Public Property Get Sounds(ByVal Item As String) As clsSound
Set Sounds = m_Sound
This code should play the sound which name is passed as param in Sounds property from clsGame... obviously it doesn't work because I cannot pass 'Item' from Sound property to 'Play' method, unless I've to move the param from the property into the sub, or keep 'Item' as public var somewhere else or save it into registry and delete it when it isn't more in use.
Public Sub Play()
'Play a sound here
There's a work-around to use a param of a property of a class into another class without creating public vars or other?
Then, I'd to know how to create default properties (such as the Text property for Textboxes or Caption for Labels, etc...). Most programmers said me it's not possible, but I don't believe that. In fact, reading from MSDN I discovered that it would be possible (even if there isn't how to do it)... So I hope you know how.
That's all folks.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.