Intro to windows app
description
Transcript of Intro to windows app
Let’s StartIntro To Windows Apps
UsingC#
Develop Simple Calculator
Out LinesPurpose of this session
Dos vs Windows
Windows applications concepts
Example (make calculator using win forms 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)
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
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
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
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
Common Controls
Each control has its own Properties & EventsProperty as: Background color Event as: Click
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
Let’s StartWe will develop a calculator
Design Form
Choose Contro
ls
Handle Events
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”
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
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
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
Dos Vs Win
Windows Applications
Forms (Windows Forms)
GUI Controls
Events
Example on Simple Calculator
Summary
Questions ?