View previous topic :: View next topic |
Author |
Message |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Tue Mar 31, 2009 5:53 pm Post subject: VB.NET adding new properties to objects |
|
|
I'm using the control button but I want to add a property in that control to store data for example 'button1.password="Dark Byte"' , how would I do that?
_________________
CEF will always stay alive. |
|
Back to top |
|
 |
shhac Expert Cheater
Reputation: 0
Joined: 30 Oct 2007 Posts: 108
|
Posted: Thu Apr 02, 2009 3:38 pm Post subject: |
|
|
Make a new User Control that inherits System.Window.Forms.Button then add the extra things you want to it, then use the new control that you've made rather than the normal Button when designing the form.
I gave it a try but couldn't work out how to make the new control appear in the toolbox. Good Luck!
|
|
Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Apr 02, 2009 4:19 pm Post subject: |
|
|
There is a property on controls called "Tag" of object type, so you can assign anything to it, but I don't think that suits your current need. What I would suggest is simply storing a string variable which contains your password.
_________________
|
|
Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Thu Apr 02, 2009 8:44 pm Post subject: |
|
|
samuri25404 wrote: | There is a property on controls called "Tag" of object type, so you can assign anything to it, but I don't think that suits your current need. What I would suggest is simply storing a string variable which contains your password. |
Ya but I'm using 10+ buttons that are being created at runtime & it would be hard to keep track of them doing that.
_________________
CEF will always stay alive. |
|
Back to top |
|
 |
shhac Expert Cheater
Reputation: 0
Joined: 30 Oct 2007 Posts: 108
|
Posted: Thu Apr 02, 2009 9:18 pm Post subject: |
|
|
Jorg hi wrote: | samuri25404 wrote: | There is a property on controls called "Tag" of object type, so you can assign anything to it, but I don't think that suits your current need. What I would suggest is simply storing a string variable which contains your password. |
Ya but I'm using 10+ buttons that are being created at runtime & it would be hard to keep track of them doing that. | You could use the tag to store an integer then have a multidimensional array with the tag's value as the index of extra things you want.
|
|
Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Fri Apr 03, 2009 5:44 am Post subject: |
|
|
shhac wrote: | Jorg hi wrote: | samuri25404 wrote: | There is a property on controls called "Tag" of object type, so you can assign anything to it, but I don't think that suits your current need. What I would suggest is simply storing a string variable which contains your password. |
Ya but I'm using 10+ buttons that are being created at runtime & it would be hard to keep track of them doing that. | You could use the tag to store an integer then have a multidimensional array with the tag's value as the index of extra things you want. |
or could I make the tag object like a list collection?
_________________
CEF will always stay alive. |
|
Back to top |
|
 |
|