C# - How To Open Form by String Name - Stack Overflow
C# - How To Open Form by String Name - Stack Overflow
- Stack Overflow
If i get string value from textbox and my Form name is same string value from textbox. How to
open this form ?
-2
string formAAA = textbox.text; // "AAA"
c# winforms
Sorted by:
4 Answers
Highest score (default)
form.ShowDialog();
2 If you think this answered your question then please mark it as the answer to help others find the
correct answer quickly and also give Hüseyin the credits. – MrApnea May 30, 2016 at 13:51
0 Opening a form is creating an instance of it, you need to create the instance and show it.
You are going to need the name of the form and its namespace.
https://stackoverflow.com/questions/37522945/how-to-open-form-by-string-name 1/3
30/12/2022 15:48 c# - How to open form by string name? - Stack Overflow
frm.show();
Use below:
Join Stack Overflow to find the best answer to your technical question, help others
Sign up
answer theirs.
https://stackoverflow.com/questions/37522945/how-to-open-form-by-string-name 3/3