Main Loop in Windows Form

Abdul Hayee

Member
Joined
Mar 31, 2020
Messages
15
Programming Experience
Beginner
Hi Guys.
I have a very simple question. I am basically a Microcontroller Programmer using C language. In this there is a Main Loop which always executes and we call different functions from here.
In C# Windows form which is the Main Loop which always get executes and do different functions. I have a very simple program, below is the picture of Main Program

1.png

if we see public Form1(), this loop is printing line only for one time, so i think it is not the main loop. right?
Kindly tell me about this.
I am writing a program which have different buttons and according to these buttons i have to execute/stop execute things.
Hopefully you guys are getting my point

Thanks
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,277
Location
Sydney, Australia
Programming Experience
10+
WinForms apps are event-driven. All you need to do is handle the Click event of each Button and do whatever it is you need to do. There's no "main loop" at the level of your code. The application effectively just sits there, waiting for the user to do something.
 
Top Bottom