tags:

views:

29

answers:

2

Let's say I have 5 buttons aligned in a row, and the text on the buttons cycle when I click on any of them. I want to turn this into a single control, so that I can create more of these "5 button" controls with similar behavior.

What would be the best way to create this sort of control, while still sort of preserving the control of the 5 buttons?

+1  A: 

I think from the very beginning you should have a UserControl, where you group all your controls (buttons, text box), so you won't have to create it dynamically.

Vitalij
A: 

Create a custom control with 5 buttons, add the custom events for the buttons and use it as a single control anywhere.

Vinod Maurya
I think CustomControl is really an overkill here. I use CustomControl in case you need completely different behaviour from the standard controls, but for sure that is not the case. Here you need to group controls only.
Vitalij