C
C#12mo 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
Anu6is12mo 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
OSWIN12mo ago
@anu6is this is what i meant via editor being able to add buttons and what not
Anu6is
Anu6is12mo 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
OSWIN12mo ago
@anu6is
TheBoxyBear
TheBoxyBear12mo ago
You need to create it as a form in the project and create an instance of it when the button is clicked
Anu6is
Anu6is12mo 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
OSWIN12mo ago
ahhh now i get it where do i create a form in editor tho its not in toolbox
Anu6is
Anu6is12mo ago
You add form like you'd add a class in the solution explorer
OSWIN
OSWIN12mo ago
done thanks !close
Accord
Accord12mo ago
Closed!
Jdance
Jdance12mo 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
Accord12mo 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
More Posts
✅ is there a way to read names of image filesI want to create a program tht reads name of image all files in a folder and uploads it to a SQL dat❔ How to deploy asp.net sites to Docker IIS?Before we used to deploy sites via the IIS folder. But how can we we deploy to IIS in Docker? I'm no❔ signalr optimistic updates excluding the connection of the user posting the messageSo, I'm using signalr IHubContext to push a notification from server to client after I've confirmed ❔ Data Layer communicating ultimately to API controllerHello 👋 I was wondering if someone has a best practice for this? 😁 I want that my Data Access L❔ .NET 4x not installingI tried to install multiple different versions of .net 4x but none of them actually installed, whileButton that downloads a file from a link to a websiteI need to click a button and it will download a file from a website link❔ ✅ Use Reflection or Generics to specify one or more propertiesI'm writing something that will automatically create a table and fill it with data based on the prop❔ What's the difference between `IConfiguration.Get` and `IConfiguration.Bind`?The docs say `Get` "Attempts to bind the configuration instance to a new instance of type T. If this❔ Best place to store a flag globally on ASP.NET CoreHello everyone. What I'm trying to achieve is given a list of users that each have access to 1...N ❔ C# app on LinuxHello , I'm trying to create a C# app on Linux but I think it's just not possible. I tried multiple