C
C#17mo ago
OSWIN

❔ ✅ Winforms

my code creates a new form when a button is clicked but how do i get that new forms code and display it in that editing window any help?
12 Replies
Anu6is
Anu6is17mo ago
Editing window? You mean the form designer or code viewer in VS? If so, you can't see a runtime (code) generated form in the editor You can make a form in the designer and have your button open that
OSWIN
OSWINOP17mo ago
@anu6is this is what i meant via editor being able to add buttons and what not
Anu6is
Anu6is17mo ago
Ok, but I still don't understand your question Yes this is the editor. What is the code you have that creates a form?
OSWIN
OSWINOP17mo ago
@anu6is
TheBoxyBear
TheBoxyBear17mo ago
You need to create it as a form in the project and create an instance of it when the button is clicked
Anu6is
Anu6is17mo ago
^ Like I said, if you are creating that form in code you can't see it in the editor You have to create it in the editor FIRST, then have your code show it The only way you can edit it in the designer is to create it in the designer
OSWIN
OSWINOP17mo ago
ahhh now i get it where do i create a form in editor tho its not in toolbox
Anu6is
Anu6is17mo ago
You add form like you'd add a class in the solution explorer
OSWIN
OSWINOP17mo ago
done thanks !close
Accord
Accord17mo ago
Closed!
Jdance
Jdance17mo ago
Awfully confused by this, but are you simply trying to execute code when the button is pressed? Didn't realize it was closed, my bad. 🤦‍♂️ Ignore my stupidity.
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server