Topic: Visual C#: Adding variables to the RadioButton object

Hey all,

For a quite useless thing I'm working on I'd like to extend the RadioButton class/property with two extra variables: dirleft and dirtop. I tried with

public partial class props : RadioButton
{
public bool dirleft;
public bool dirtop;
}

but that didn't work sad

Basically I just want two extra variables to be created whenever a radiobutton is created. This would certainly save me a hell of a lot of work for a simple program like this tongue

Any suggestions? Is it even possible? It would be damn handy if it was ^^

Thanks,
-- Bekko

2 (edited by Jansson 2006-11-19 14:09)

Re: Visual C#: Adding variables to the RadioButton object

I had the same problem when I wanted to store extra data in a treenode. I ended up making a new object for the variables, and then putting it in the TreeNode.Tag member.

Should be able to do the same thing with radiobutton

Re: Visual C#: Adding variables to the RadioButton object

That only seems to work for individual ones, unlike the TreeNode =/

Any other suggestions?