Custom Property Question

  • Thread starter Thread starter sotto
  • Start date Start date
S

sotto

Is there another way to acomplish this? (code below)

the property SoundFile needs only be set when the SoundType is set to
Custom.
I'd like to get the same functionality with only setting one property.

Is there a way to have the vs IDE list a set of pre-set strings (the
SoundButton.bip.wav and so on) and give the possibility to enter your
own string?

(What i do here is giving the option to set the property to some
built-in sounds, or pass an external soundfile to my usercontrol)


Thx for your help



Private mSoundfile As String
Private mSoundType As enumSoundType

Public Enum enumSoundType
Custom
Bip
Blubup
Dink
End Enum
Public Property SoundType() As enumSoundType
Get
Return Me.mSoundType
End Get
Set(ByVal Value As enumSoundType)
Me.mSoundType = Value
Select Case Value
Case enumSoundType.Bip : Me.mSoundfile =
"SoundButton.bip.wav"
Case enumSoundType.Blubup : Me.mSoundfile =
"SoundButton.blubup.wav"
Case enumSoundType.Dink : Me.mSoundfile =
"SoundButton.dink.wav"
Case enumSoundType.Custom : Me.mSoundfile = ""
End Select
End Set
End Property
Public Property SoundFile() As String
Get
Return Me.mSoundfile
End Get
Set(ByVal Value As String)
Me.mSoundfile = Value
End Set
End Property
 
Back
Top