C# Windows Forms Application? | Sololearn: Learn to code for FREE!


C# Windows Forms Application?

I have very little programming experience. Using Visual Studio Community, I can create a window with C#. The window creation requires that I use drag and drop to add things to the window. Is it possible to do all of this by just typing code? Like creating a window and adding things like buttons and text boxes without relying on drag and drop? I mean, drag and drop is nice and easy, and i'd prefer that over just typing code, but i'm just curious xD

12/3/2018 4:25:42 PM

Daniel Cooper

3 Answers

New Answer


Sure, every form or button or text box has been created for you using classes and methods somebody else has written, so, of course you can do it yourself. This is something similar, you may find it useful, take a look: https://docs.microsoft.com/en-us/dotnet/framework/winforms/how-to-create-a-windows-forms-application-from-the-command-line


This is a good question. Take my answer with a grain of salt because I haven't made much windows form applications but I would say yes. Anyone else feel free to correct me if I'm wrong, but this is handled by the .NET framework. Which is a collection of libraries to make your life allot easier using c#. That being said you can make your own libraries for your project. With that in mind in don't see why it wouldn't be possible to do it yourself. But again haven't worked much with wfa so if I'm wrong I'd gladly hear so from someone else.


This dynamically creates a TextBox control and adds it to the windows form. TextBox tb = New TextBox; tb. Location = New Point(50,100); this.Controls.Add(tb);