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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top