Create multi element property?

  • Thread starter Thread starter Grahammer
  • Start date Start date
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
 
Hi Grahammer,

Dit you try the imageindex (using the imagelist) from the button, seems to
me the first point to try?

Cor
 
Back
Top