Sign in to follow this  
Ksingh30

C# VS 2005

Recommended Posts

Ksingh30    100
hi. ok im making a windows app. what I got is a text bar and this textbar will get in put in this form (q1,q2,q3, .....,qn) then i got this struct state, what i need to do is create n instance of this struct and each ones name has to correspont to the value in the testbar. for example i need to do state q1; so my questions is how can I take text from a textbar and use that text as a name for a struct instance.

Share this post


Link to post
Share on other sites
jfclavette    1058
What are you trying to achieve ? I'm not sure I understand. You can't "name" instances at runtime in any way that makes sense.

Perhaps what you would want is a Dictionary<string, MyStruct> where the key is the content of the 'textbar'.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this