How can I use arrays of buttons (in c++ ?)
Because it is a managed code , and a c array is native - it did not accept it.
Can I use array of buttons directly using the winapi ? where can I see a sample of using the winAPI directly. ?
How can I use arrays of buttons (in c++ ?)
Because it is a managed code , and a c array is native - it did not accept it.
Can I use array of buttons directly using the winapi ? where can I see a sample of using the winAPI directly. ?
theForger's Win32 API Tutorial
At the winapi level there is no such thing as an "array of buttons", this is some concoction of a higher level language. There are, however, ways to link multiple buttons into mutually exclusive groups so that if you check one the others become unchecked.... this is done by the way you set the button's window styles.
Isn't there some way to maintain an array of pointers to the Buttons via the Button.Handle property?
If you understand what you're doing, you're not learning anything.
A button in C# is a control. You should be able to create a list of these with no problem in C#. Why are you asking managed questions, though, on an unmanaged forum? We have a forum for C#. I will not move the thread yet b/c your post was so vague that I'm not sure what you are asking about.
FWIW... I've seen the "array of buttons" thing before. Most often it refers to a group of buttons in a groupbox that are mutually exclusive (i.e. radio buttons). Windows maintains this invisibly by making any contiguous group of buttons with the BS_RADIOBUTTON style, mutually exclusive.
If you drag the radio buttons into the same group box this is done automatically. If you look at the resulting .designer.cs file you can see exactly how this is done in code.FWIW... I've seen the "array of buttons" thing before. Most often it refers to a group of buttons in a groupbox that are mutually exclusive (i.e. radio buttons). Windows maintains this invisibly by making any contiguous group of buttons with the BS_RADIOBUTTON style, mutually exclusive.
Its done automatically by CreateWindow() *anyway*...
Make the group box with the WS_GROUP style.
Make your buttons right after with the BS_RADIOBUTTON style
Make your next control with the WS_GROUP style.
All the buttons between the two controls with WS_GROUP will be a mutually exclusive group. It's nothing special, just a matter of organization.