Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Do I need the "main file" to code on c# when working with Windows Forms Application

i recently switched from console application to windows form application in C# and i was wondering, if I work with buttons and etc. do i really need to work with the main file(The file where the void main is and the 2 lines of code with

 ApplicationConfiguration.Initialize();
 Application.Run(new Form1());

)
anymore and if not how can i check if a button for example is pressed in the main file?
Im wondering because the buttons and etc are private and cant be called outside the form.cs. I hope i could describe it good enough.

The file is pointing to the "main file"

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You do not need to use main file. you can write code on Form1_load event. When you windows application starts, the main function will be executed and it will load Form1. You can put your buttons on Form1 and also write code on Button_Click events.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading