Help Me
-
I want select my form name from combo box and then list my selected form controlsname in list box but selecteditem in combobox is a string and control property for string is not valied please help me
-
I can think of two ways. Either use
System.Activator.CreateInstanceFrom
or have the value member of the combo as the instance of the form. -
I want select my form name from combo box and then list my selected form controlsname in list box but selecteditem in combobox is a string and control property for string is not valied please help me
I assume this means you tried using what I told you yesterday, but don't really know much of anything about C# or winforms. Your forms have a Text property which is the title of the window. You can also use GetType().ToString() to get the name of the class. Either way, you really need to read a basic winforms book, so you can understand the answers you're given you should also consider reading the posting guide - help me is obviously useless as a title, everyone posting here wants help.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
I assume this means you tried using what I told you yesterday, but don't really know much of anything about C# or winforms. Your forms have a Text property which is the title of the window. You can also use GetType().ToString() to get the name of the class. Either way, you really need to read a basic winforms book, so you can understand the answers you're given you should also consider reading the posting guide - help me is obviously useless as a title, everyone posting here wants help.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
Christian Graus wrote:
You can also use GetType().ToString() to get the name of the class.
Could not get this. How can you get the instance of form by the a string variable having its text (I guess this is what he asked) using GetType(). Can you show some example?
-
Christian Graus wrote:
You can also use GetType().ToString() to get the name of the class.
Could not get this. How can you get the instance of form by the a string variable having its text (I guess this is what he asked) using GetType(). Can you show some example?
d@nish wrote:
How can you get the instance of form by the a string variable having its text (I guess this is what he asked) using GetType().
You don't, that's not what he asked. He asked how to get the open forms, and I said Application.Current.OpenForms ( or something like that ). He's then tried to assign THAT to his combo, instead of getting the strings he wants from there.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp