G
Grahammer
Is it possible to create a multi element property in VB.Net? Something
similar to the "Location" or "Size" property. Each of these has two
elements.
I'm trying to create an IMAGE property that has four different elements. One
for each state of a button.
I would set the image for a normal button like this:
MyButton.ButtonImage(ButtonStates.Normal) = imgButtons.Images(0)
This is how I would have expected to write it, but it doesn't work...
Public Enum ButtonStates
Normal
Hot
Pushed
Disabled
End Enum
Public Property ButtonImage(ByVal state As ButtonStates) As image
Get
Return imgImages.Images(state)
End Get
'Problem here. Set only take one argument. How do I specify my index
(ButtonState)
Set(ByVal idx As ButtonStates, ByVal Value As image)
imgImages.Images(idx) = Value
End Set
End Property
similar to the "Location" or "Size" property. Each of these has two
elements.
I'm trying to create an IMAGE property that has four different elements. One
for each state of a button.
I would set the image for a normal button like this:
MyButton.ButtonImage(ButtonStates.Normal) = imgButtons.Images(0)
This is how I would have expected to write it, but it doesn't work...
Public Enum ButtonStates
Normal
Hot
Pushed
Disabled
End Enum
Public Property ButtonImage(ByVal state As ButtonStates) As image
Get
Return imgImages.Images(state)
End Get
'Problem here. Set only take one argument. How do I specify my index
(ButtonState)
Set(ByVal idx As ButtonStates, ByVal Value As image)
imgImages.Images(idx) = Value
End Set
End Property