Introduction to Windows Programming Contrasting Windows and Console

  • Slides: 6
Download presentation
Introduction to Windows Programming

Introduction to Windows Programming

Contrasting Windows and Console Applications • Console applications – Each line in Main( )

Contrasting Windows and Console Applications • Console applications – Each line in Main( ) executed sequentially – then the program halts • Windows applications – Once launched, sits and waits for an event – Sits in a process loop • Event: notification from operating system that an action, such as the user clicking the mouse or pressing a key, has occurred – Write event-handler methods for Windows apps

Graphical User Interface • Windows applications also look different from console applications • Interface:

Graphical User Interface • Windows applications also look different from console applications • Interface: front end of a program – Visual image you see when you run a program – Graphical user interface (GUI) • Graphical user interface (GUI) includes: – Menus – Text in many different colors and sizes – Other controls (pictures, buttons, etc. )

using System. Windows. Forms; Base class namespace Windows. App { public class Form 1

using System. Windows. Forms; Base class namespace Windows. App { public class Form 1 : Form { Constructor public Form 1( ) { Text = "Simple Windows Application"; } static void Main( ) { Form 1 win. Form = new Form 1( ); Application. Run(win. Form); } Starts } process } loop

Windows Application Output generated from Windows application Graphical user interface (GUI) Windows-based form

Windows Application Output generated from Windows application Graphical user interface (GUI) Windows-based form

The Concept For Windows programming, Visual Studio presents you with two development Windows: 1.

The Concept For Windows programming, Visual Studio presents you with two development Windows: 1. Graphical Design Window – for the user interface You select, drag and drop visual artifacts such textboxes, buttons, etc. from the Toolbox pane onto the Designer Canvas. Visual Studio automatically generates the code for these artifacts. 2. Program Code Window – for the program which reacts to a user interacting with the artifacts in the Design Window, e. g. a user clicking a button.