Windows Form Application C
Windows Form Application C
C#
Project Task: Login Form
GROUP MEMBERS
NO.
NAMES
ROLL NUMBERS
MASHARI MAHMOOD
MUHAMMAD KHAN
F13BA004
SALMAN FAISAL
F13BA032
SADAQAT NIAZI
DIFFERENCE
WEB BASED APPLICATIONS
IDE: Form1.cs
Integrated Development Environment (IDE)
Form1.cs: code, design and design code
Logic codes
Form
Designer
Designer
codes
IDE: Form1.cs
IDE: Form1.cs
IDE: Form1.cs
Toolbar
How to find this window?
Menu: View > Toolbar
If AutoHide is set
Toolbar
Toolbar window is Context sensitive
It will show the controls ONLY in the Design View: Eg Form1.cs
[Design]
Toolbar
Categories:
- All Windows Forms
- Common Controls
And others
Use All Windows Forms
to search for unknown
Use Common Controls
for normal usage
Properties Window
How to view Properties Window?
Menu: View > Properties Window
Properties Window
Name of Control
Sort by category
Sort from A to Z
Properties
Event
Property page: available
when solution or project
is selected
Properties Window
Properties
Try changing the
Text property from
Form1 to First
WinForm App
Click on Form1 and
type over
Properties Window
Events
Shows all the
events available for
this control
Try add logic for
Form1 Load event by
double-clicking on
Load
Properties Window
Add the following codes into the Form1
Load event:
OR
Icon, then double-clicking on Click
Code Behind
Microsoft invented Code Behind using
Partial Class allows a class to be split into
more than 1 file
Prior to Code Behind- code for logic and
design were placed in the same Class file:
Inline. Code Behind allows logic and
design code to be separated
Partial class Form1
{
:
}
Where to output?
For Console Program: using Console.Write() or
Console.WriteLine may still use it for debugging =>
Output window
Two ways to output for Winform Apps
Pop up a message box with the output
How to input?
Get inputs from various controls
TextBox: Text property (Eg textBox1.Text)
CheckBox: Checked property (Eg
checkBox1.Checked)
ListBox: SelectedIndex property
Importance
Build Rich, interactive user interfaces:
Events
When a user does something to your form or
one of its controls
application reacts to these events by using
o
code,
text boxes,
buttons,
drop-down boxes,
radio buttons,
Custom UI elements
If one needs to create own custom UI elements, the
System.Drawingnamespace contains all of the classes
one needs to render
o
lines,
circles,
other shapes
directly on a form
ATTENTION PLEASE
NOW WE ARE GOING TO EXPLAIN CODE
AND RUN THE PROGRAM