+ 1
C# Forms(Solved)
So I'm playing around with C# and figured out how to write and compile c# code. But When I make a form, it always opens a blank console window along with the form window. Is there a way for me to hide it, or prevent it from opening? Edit: I'm not using an ide, I'm compiling via command prompt. Edit 2: I just made the code public on my profile. It won't work in SL but I hope it helps. Edit 3: I had solved this myself a while ago, so I'm good now. Turns out I was compiling a console application rather than a Windows application
12 ответов
+ 2
yea i don't think you want to code wihout an ide, it's un user-friendly, and doesn't have all the features in an ide like debugger when you used a notepad to write the code.
i suggest using visual studio for making c# forms, it's very easy to make your forms when you're using an ide and those pesky console terminal would not appear when you run it.
+ 2
great!
just a tip though, sometimes a simple solution is much better than a complex one.
trying to reinvent the wheel by creating forms manually would get you to learn how it works, but you'll simply ended up doing unnecessary workload and not get a lot of stuff done.
think of it like trying to build a house using sticks and stones instead of using the modern tools available.
this has something to do with the "arrogance mentality" where programmers think they should do things the hard way to prove themselves that they can code the real way.
not only does this obstruct your learning progress, this would also block the reason programmers code, to get stuff done.
and lastly, there is no need to prove yourself that you can code
it the hard way, only ignorance is telling you that.
it's up to you whether you want to follow this advice or not, i'm simply giving you a better alternative.
+ 2
Daniel Cooper It sounds like the csproj file output is configured as EXE instead of WinExe.
That said, I've never heard of anyone developing WinForms or any .NET application without the VS.NET IDE.
In fact, the last time I used the command line compiler was before the first release of Visual Studio.NET.
Seriously, you will gain nothing, other than a painful experience, with this approach.
Using the drag and drop designer is simply for applying styling and positioning properties to UI controls. These have very little to do with the actual language.
It would be like a graphic designer forcing themselves to learn SVG to manually draw a graphic rather than using Adobe Illustrator. It makes no sense.
Do yourself a favor and learn the tools in VS.NET IDE. Spend your time focused on mastering the language itself rather than learning about things the IDE will do better and much faster than you could on your own.
+ 1
David Carroll Haha. I really just wanted to see if somebody would tell me that. Nah, I just don't have it installed and can't currently install it. I forgot I deleted it and I don't have wifi to install it :(
+ 1
you should try Visual Studio IDE for developing your C# app
+ 1
Matengele Kaira I actually still have vs code installed. I generally use notepad++ but I guess it wouldn't hurt to use vscode.
And just so everyone is aware, I had figured out the problem a while ago. Lol
0
something feels wrong to me about checking boxes and using drop-down menus to make a form instead of coding it myself. That is not learning the C# programming language, that is learning how to use Visual Studio.
I didnt type this but it kinda sums up how I feel.
0
I ended up figuring it out anyway
0
Hi Daniel, in most business applications , creating the controls and layout is considered boiler plate work, its not the problem being solved by the application so its usually autogenerated by tools like form designers regardless of the language. if you really want to learn how these controls are declared, drag them onto a designer and see the code generated for you. Usually the problem being solved by an application involves binding data to screen controls based on events from a user, persisting an retrieving data from a data store and building some form of collection of the data in memory to iterate over with some control flow and test for certain scenarions with conditional logic operator (business logic using data structures and algrithms ). This is how business problems are solved and i believe its that type of code that you want to deeply understand. remeber a client wants the best solution they can get in the shortest possible time.Each technology has its own convention of UI so cant hand code them all
0
Matengele Kaira I know. I was seeing of y'all would say the same thing if I said that. The real reason I'm not using Visual Studio or anything like it, is because I don't currently have internet, lol. I'd love to be using it atm, it'd make things so much easier.
0
hehehehehehe , great , also when you do get some internet try visual studio code , its less than 100mb and is amazing.
0
Please check whether you set the start up project and start up file properly to show the expected output.