intro to windows app

16
Let’s Start Intro To Windows Apps Using C# Develop Simple Calculator

Upload: devmix

Post on 20-May-2015

805 views

Category:

Education


1 download

DESCRIPTION

Event #3 for DevMix Team

TRANSCRIPT

Page 1: Intro to windows app

Let’s StartIntro To Windows Apps

UsingC#

Develop Simple Calculator

Page 2: Intro to windows app

Out LinesPurpose of this session

Dos vs Windows

Windows applications concepts

Example (make calculator using win forms app)

Page 3: Intro to windows app

PurposeWhat’s this session for ?

For making a calculator using C#False

False !!, for What ?!!I will tell you

This session for begin using C# to develop our first windows application

PurposeNot to make a calculator (Simply it’s

nothing)

To learn how to make windows apps (I got it)

Page 4: Intro to windows app

Dos vs WinDos

Very poor operating systemEvery thing is textBased on commands

WindowsThe most popular operating systemMore friendly to userBased on graphical user interfaces (GUIs)

Absolutely there is other differences but this what we need right now

Page 5: Intro to windows app

Windows appsIt’s applications used for windows OS

Graphical user interface appsAllows a user to interact visually Buttons , text-boxes , labels , …

Windows formsUsed to create the GUIs

Windows Applications

Page 6: Intro to windows app

FormsGraphical element that appears on your computer's desktop asDialogsSDI Window (single document interface)

MDI Window (multiple document interface)

The place where we can but GUI

controls

Page 7: Intro to windows app

ControlsWindows app as said before consist of

Buttons , labels , text-boxes , … etc.

These is called GUI controlsGUI controls are objects that can

Display information on the screenEnable users to interact with an app via mouse,

keyboardSome other form of input as voice commands

Page 8: Intro to windows app

Common Controls

Each control has its own Properties & EventsProperty as: Background color Event as: Click

Page 9: Intro to windows app

EventsEvent is “Something occur”

When we click the mouse this is an eventWhen we type on the keyboard this is an event

GUIs are event driven which meanEach event, must have its own handler

HandlerMethod perform a task in response to events

Page 10: Intro to windows app

Let’s StartWe will develop a calculator

Design Form

Choose Contro

ls

Handle Events

Page 11: Intro to windows app

What For ? What type of calculators user need? for what ?

Simple, Basic calculationsAdvanced, Complex calculationsCustom, Custom type of calculationsMix All of them

Simply if you made one you can make all

Because its only “idea”

Page 12: Intro to windows app

Let’s ProgramWe will make the simple one

Simply because there isn’t remaining timeIt’s the root of all others

We will use Visual Studio As IDESimply because it’s the best

We will use C# as PLSimply because it’s the Strongest

Now Let’s ProgramOkay let’s do it

Page 13: Intro to windows app

Let’s Think & ImagineNeed to get input from the user

Can use some buttons to read numbers & operations Can use text-box to show operands, results

Convert the input in text box to numbers Can use parse( ) method

Store this input in variables for making calculations double fNum , sNum ;

Make operations on the values stored in variables double result = fNum ( Operation [+,-,*,/] ) sNum ;

Show the final result to user Show it in the text-box

Page 14: Intro to windows app

Let’s CodeWe should now start to code

At this stage we will convert our thinking & imagination into real world application

This could be done by writing some steps based on our thinking & imagination

Page 15: Intro to windows app

Dos Vs Win

Windows Applications

Forms (Windows Forms)

GUI Controls

Events

Example on Simple Calculator

Summary

Page 16: Intro to windows app

Questions ?