By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,639 Members | 1,988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,639 IT Pros & Developers. It's quick & easy.

Create multi element property?

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Cor
Hi Grahammer,

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

Cor
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

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.