I'm not sure if this is even possible. I've done some research, but haven't been able to find anything conclusive. There is a similar question here, but it's for WPF.
What I'd like to do is add a custom property to an existing WinForms GroupBox (or any control) on my form. For this example we'll use "Link". Say each GroupBox in my program contains a hyperlink, and then all I would need to do when I start my program is do this:
MyGroupBox.Link = "http:\\www.google.com\"
Later in my program I could set my hyperlink content to refer to MyGroupBox.Link
.
Is it possible to manipulate a Winforms control like this? I'd rather not make a custom control if I don't have to.
I saw from this question that I could extend my control, but how I would that look in my particular case? Is that the same as creating a custom control?
Tag
property that basically justobject
, so you can set any data to it, and use it. You can set any url to it, and then get it and cast back to string. – Sergey LitvinovTag
, then you'll have to create a derived custom control. See msdn.microsoft.com/en-us/library/7h62478z(v=vs.90).aspx for an example. – Jim Mischel