SlideShare a Scribd company logo
FEDT VB.NET
F R O N T E N D D E S I G N T O O L
U S I N G
V B . N E T
P R E S E N T A T I O N B Y :
A N K I T V E R M A
( I T D E P A R T M E N T )
A N K I T V E R M A A S S T . P R O F E S S O R
U N I T - 3
Interface
 User interacts with application using well-defined user
interface.
 Two types of interface:
 CUI (Character User Interface)
 Commands for user interaction
 Not much user friendly
 E.g. Console Application
 GUI (Graphical User Interface)
 No need to remember commands
 Very easy to use & user friendly
 E.g. Windows Application
28-11-2014 ANKIT VERMA 2
28-11-2014 ANKIT VERMA 3
WINDOWS FORMS
Windows Form
 Accept input from user & display information.
 Develop desktop based application.
 Provides full support of database connectivity & image
formats.
 System.Windows.Forms namespace support Form
Class.
 Title Bar, Menu Bar & Control Box are at top of form.
 Main area is called Client Area, surrounded by border.
 Form associated controls enriched with predefined
Properties, Methods & Events.
28-11-2014 ANKIT VERMA 4
Windows Form
 Properties
 Define characteristics of controls like color, size, border etc.
 Methods
 Methods are defined by the action that an object can perform.
 Events
 These are actions that can be recognized by the objects.
 Event occur when the user, OS or application interact with
objects of program.
 They control the appearance & behavior of a form either at
design time or run time.
28-11-2014 ANKIT VERMA 5
Windows Form: Properties & Methods
 Backcolor
 BackgroundImage
 FormBorderStyle
 None
 Fixed Single
 Sizeable
 Fixed Dialog
 Fixed 3D
 Fixed Tool Window
 Sizeable Tool Window
 MaximizeBox
28-11-2014 ANKIT VERMA 6
Windows Form: Properties & Methods
 MaximizeBox
 MinimizeBox
 Text
 WindowState
 StartPosition
 CenterParent
 Manual
 CenterScreen
 WindowDefaultBounds
 WindowDefaultLocation
28-11-2014 ANKIT VERMA 7
Windows Form: Properties & Methods
 Activate
 Close
 Show
 Refresh
 Hide
 Dispose
28-11-2014 ANKIT VERMA 8
Windows Form : Example
 Example 1:
28-11-2014 ANKIT VERMA 9
Windows Form : Example
 Example 2:
28-11-2014 ANKIT VERMA 10
Windows Form: Events
 Activated
 Deactivate
 Click
 Load
 Closing
 Closed
28-11-2014 ANKIT VERMA 11
MDI Forms
 Display multiple windows at same time.
 MDI form act as parent form or container for all other
forms, called MDI parent form.
 Contain Menu Bar, Tool Bar and Status Bar.
 E.g. Word
 By default, VB.NET support SDI application, where
only one window displayed at a time.
 E.g. Wordpad
 In MDI Application, child forms are displayed as
independent windows under parent MDI window.
28-11-2014 ANKIT VERMA 12
MDI Forms
 Create a form & set IsMDIContainer property true, it
will act as container.
 Attach the menus to MIDI parent form.
 Click event of menu item, write:
Form2.Show()
 Add one more Form to project.
 Write code on load of Second Form:
Me.MdiParent = Form1
 Run the code & click on menu item.
28-11-2014 ANKIT VERMA 13
MDI Forms
28-11-2014 ANKIT VERMA 14
28-11-2014 ANKIT VERMA 15
CONTROLS
Controls
 Major controls are:
 Label
 Linklabel
 Textbox
 Button
 Checkbox
 Listbox
 Radiobutton
 Combobox
 Groupbox
 Hscrollbar
28-11-2014 ANKIT VERMA 16
 Vscrollbar
 Picturebox
 Timer
 ListView
 TreeView
 Panel
 ToolBar
 StatusBar
Controls : Properties & Methods
 Properties & Methods of controls are:
 Backcolor
 Forecolor
 Size
 Enable
 Locked
 Visible
 Location
 Font
 Maximum Size
 Minimum Size
28-11-2014 ANKIT VERMA 17
 Hide
 Show
 Select
 Refresh
28-11-2014 ANKIT VERMA 18
Label
Label
 Graphic control used to display text.
 User can’t edit text directly.
 Text properties can be set at Run Time / Design Time.
 It is in System.Windows.Form.Label class.
 Label can’t receive focus.
 Label Properties are:
 AutoSize
 BorderStyle
 Enabled
 Text Align
 Text
28-11-2014 ANKIT VERMA 19
Label : Example
 Example:
28-11-2014 ANKIT VERMA 20
28-11-2014 ANKIT VERMA 21
Textbox
Textbox
 Accept input from user & retrieve data from database.
 Textbox can be Multiline, Editable or ReadOnly.
 It is subclass of System.Windows.Forms.TextBoxBase
Class.
28-11-2014 ANKIT VERMA 22
Textbox : Properties & Methods
 Textbox Properties & Methods:
 Borderstyle
 MaxLength
 PasswordChar
 ReadOnly
 MultiLine
 Textbox Events:
 GotFocus
 LostFocus
 Click
 TextChanged
 KeyPress
28-11-2014 ANKIT VERMA 23
 ScrollBars
 SelectedText
 TextAlign
 WordWrap
 AppendText
 Text
 Clear
 Select
 SelectAll
 Show
 Cut
 Copy
 Paste
Textbox : Example
 Example:
28-11-2014 ANKIT VERMA 24
28-11-2014 ANKIT VERMA 25
Link Label
Link Label
 Used to support hyperlinks.
 Derived from Label class.
 Link Label Properties:
 ActiveLinkColor
 LinkColor
 VisitedLinkColor
 LinkVisited
 Link Label Event:
 LinkClicked
28-11-2014 ANKIT VERMA 26
Link Label : Example
 Example:
28-11-2014 ANKIT VERMA 27
28-11-2014 ANKIT VERMA 28
Button
Button
 Buttons are the controls which are used for click even.
 Button Properties:
 Text
 BackgroundImage
 ImageAlign
 TextAlign
 Button Event:
 Click
28-11-2014 ANKIT VERMA 29
28-11-2014 ANKIT VERMA 30
Radio Button &
Check Box
Radio Button
 Radio button is used to select any one option at time.
 These buttons are working in a group.
 GroupBox control is used to group the related controls
together.
 If we select a radio button from the group, the other
buttons can’t be select from the same group.
28-11-2014 ANKIT VERMA 31
Radio Button : Properties & Event
 Radio Button Properties:
 Text
 AutoCheck
 Radio Button Event:
 Click
28-11-2014 ANKIT VERMA 32
CheckBox
 Checkbox is used to set yes/no or true/false options.
 User can select one option at a time.
 When we select a checkbox, a right mark appears in it,
indicating that the box is selected.
 The image and text both can be displayed in the
CheckBox control.
28-11-2014 ANKIT VERMA 33
CheckBox : Properties & Event
 CheckBox Properties:
 Text
 AutoCheck
 Checked
 ThreeState
 CheckState
 CheckBox Event:
 CheckedChanged
28-11-2014 ANKIT VERMA 34
RadioButton & CheckBox : Example
 Example:
28-11-2014 ANKIT VERMA 35
RadioButton & CheckBox : Example
28-11-2014 ANKIT VERMA 36
RadioButton & CheckBox : Example
28-11-2014 ANKIT VERMA 37
RadioButton & CheckBox : Example
28-11-2014 ANKIT VERMA 38
28-11-2014 ANKIT VERMA 39
List Box &
Combo Box
ListBox
 Display list of items to user.
 User can select one or more items from list box.
 Scroll bar appears automatically if the list has too
many items.
 User can add items to control using Design Time or
Run Time.
28-11-2014 ANKIT VERMA 40
ListBox : Properties & Events
 ListBox Properties:
 SelectionMode
 Sorted
 SelectedIndex
 SelectedItem
 MultiColumn
 Items
 Add
 ListBox Event:
 SelectedIndexChanged
28-11-2014 ANKIT VERMA 41
 Clear
 Contains
 Insert
 IndexOf
 Remove
 RemoveAt
ComboBox
 It is used to display a drop down list of items.
 It is combination of a textbox in which user enters an
item & drop down list from which user selects an item.
28-11-2014 ANKIT VERMA 42
ComboBox : Properties & Events
 ComboBox Properties:
 Sorted
 MaxLength
 SelectedIndex
 SelectedItem
 Items
 Text
 Add
 ComboBox Event:
 SelectedIndexChanged
28-11-2014 ANKIT VERMA 43
 Clear
 Contains
 Insert
 IndexOf
 Remove
 RemoveAt
ListBox & ComboBox : Example
 Example:
28-11-2014 ANKIT VERMA 44
ListBox & ComboBox : Example
28-11-2014 ANKIT VERMA 45
ListBox & ComboBox : Example
28-11-2014 ANKIT VERMA 46
28-11-2014 ANKIT VERMA 47
Picture Box &
Timer Control
PictureBox
 Used to display images, handling images, editing
images.
 Image can be added at Run Time as well as at Design
Time.
 PictureBox Properties & Methods:
 Image
 BorderStyle
 SizeMode
 Load
 PictureBox Event:
 MouseDown
28-11-2014 ANKIT VERMA 48
Timer Control
 Used to create periodic events.
 This control is not visible at Run Time.
 It work behind the scenes.
 TimerControl Properties & Methods:
 Enable
 Interval
 Start
 Stop
 TimerControl Event:
 Tick
28-11-2014 ANKIT VERMA 49
PictureBox & Timer Control : Example
 Example:
28-11-2014 ANKIT VERMA 50
PictureBox & Timer Control : Example
28-11-2014 ANKIT VERMA 51
PictureBox & Timer Control : Example
28-11-2014 ANKIT VERMA 52
28-11-2014 ANKIT VERMA 53
HScrollBar &
VScrollBar
HScrollBar & VScrollBar
 Scroll Bars are Vertical & Horizontal controls that display a
Srcoll Box or Thumb that we can manipulate.
 The value of Scroll Bar changes when we drag the Thumb into
new position.
 ScrollBar Properties:
 Value
 Minimum
 Maximum
 LargeChange
 SmallChange
 ScrollBar Event
 ScrollValueChanged:
28-11-2014 ANKIT VERMA 54
HScrollBar : Example
 Example:
28-11-2014 ANKIT VERMA 55
28-11-2014 ANKIT VERMA 56
Panel
Panel
 Panel is used to group other controls.
 It divide the form into different regions.
 Panel Control have scrollbars.
 Panel Control Properties:
 AutoScroll
 BorderStyle
28-11-2014 ANKIT VERMA 57
Panel
 Example:
28-11-2014 ANKIT VERMA 58
28-11-2014 ANKIT VERMA 59
Menus
Menus
 Provide consistent way to group commands so that
user can access them very easily.
 MenuScript control is used to create menus.
 Menus are user friendly and interactive.
 Menu Item Properties:
 Checked
 DisplayStyle
 Enable
 ShortCutKeys
 Visible
28-11-2014 ANKIT VERMA 60
Menus
 Example:
28-11-2014 ANKIT VERMA 61
28-11-2014 ANKIT VERMA 62
Exception Handling
Exception Handling : Types
 Types of Exception Handling
 Structured Exception Handling
 Structured Exception Handling is included in VB.NET
 E.g. When we open a file & file not exist, exception raised and
handled by system itself.
 Un-structured Exceptional Handling
 Un-structured Exceptional Handling of Visual Basic is still
supported in VB.NET.
 Exception class in system namespace is base class of
all Exceptions.
28-11-2014 ANKIT VERMA 63
Exception Handling : Error Types
 Three types of Errors:
 Syntax
 Appear when we write the wrong Syntax.
 Easily fixed in .NET
 Runtime
 Appear only when we Compile & Run the code.
 Logical
 Appear when we use the application, but producing wrong result.
28-11-2014 ANKIT VERMA 64
Exception Handling : System Defined
 System defined exceptions are:
 Exception
 Index Out Of Range Exception
 Null Reference Exception
 Argument Exception
 Arithmetic Exception
28-11-2014 ANKIT VERMA 65
Exception Handling : Syntax
 Syntax:
Try
Catch [exception as type]
Catch [exception as type]
Finally
[finally statement]
End Try
28-11-2014 ANKIT VERMA 66
Exception Handling
 Example:
28-11-2014 ANKIT VERMA 67
User Defined Exception
 Example:
28-11-2014 ANKIT VERMA 68
28-11-2014 ANKIT VERMA 69
ADVANCED CONTROLS
28-11-2014 ANKIT VERMA 70
List View
List View
 Used to display items.
 E.g. Window Explorer right pane
 User can view items in different modes:
 LargeIcon
 SmallIcon
 List
 Title
 Details
28-11-2014 ANKIT VERMA 71
List View : Properties & Methods
 ListView Properties & Methods:
 AllowColumnReorder
 AutoArrange
 CheckBoxes
 Columns
 GridLines
 Items
 LabelEdit
 ListView Event:
 SelectedIndexChanged
28-11-2014 ANKIT VERMA 72
 MultiSelect
 Sorting
 View
 ArrangeIcons
 Clear
 GetItemAt
List View : Example
 Example:
28-11-2014 ANKIT VERMA 73
List View : Example
 Example:
28-11-2014 ANKIT VERMA 74
28-11-2014 ANKIT VERMA 75
Tree View
Tree View
 Display hierarchy of nodes.
 Each node can have child nodes also.
 E.g. Window explorer leftpane
28-11-2014 ANKIT VERMA 76
Tree View : Properties & Events
 TreeView Properties & Methods:
 CheckBoxes
 FullRowSelcet
 LabelEdit
 Nodes
 Scrollable
 SelectedNode
 GetNodeCount
 TreeView Events:
 AfterCollapse
 BeforeCollapse
28-11-2014 ANKIT VERMA 77
 ShowLines
 ShowRootLines
 Sorted
 TopNode
 CollapseAll
 ExpandAll
 AfterExpand
 BeforeExpand
Tree View : Example
 Example:
28-11-2014 ANKIT VERMA 78
28-11-2014 ANKIT VERMA 79
ToolBar
ToolBar
 Placed after menu bar & consist of buttons.
 Different types of buttons can be created in toolbar.
 Standard Push Button
 Toggle Button
 Drop Down Button
 Separators
 Toolbar are usually docked along the top of its parent
window.
 Display tool tips when the user points the mouse
pointer at toolbar button.
28-11-2014 ANKIT VERMA 80
ToolBar : Properties & Events
 ToolBar Properties & Methods:
 Appearance
 AutoSize
 Buttons
 Divider
 ShowToolTips
 TextAlign
 Wrappable
 ToolBar Events:
 ButtonClick
28-11-2014 ANKIT VERMA 81
28-11-2014 ANKIT VERMA 82
Status Bar
StatusBar
 Appear at bottom of window.
 Display panels or simple status bar to display single
message on bar.
 StatusBar Properties & Methods:
 BackgroundImage
 Font
 Panels
 ShowPanels
 StatusBar Events:
 PanelClick
28-11-2014 ANKIT VERMA 83
28-11-2014 ANKIT VERMA 84
Common Dialog Control
Common Dialog Control
 Window application use standard dialog boxes for
common operations.
 These are implemented as standard control in toolbox.
 They are not visible at Run Time.
 Five types of dialog controls in toolbox under dialog
tabs:
 ColorDialog
 FolderBrowserDialog
 FontDialog
 OpenFileDialog
 SaveFileDialog
28-11-2014 ANKIT VERMA 85
Common Dialog Control : Color Dialog
 Color Dialog is for selecting colors from list of colors.
 ColorDialog Properties & Methods:
 Color
 CustomColors
 FullOpen
 ShowHelp
 Reset
 ShowDialog
28-11-2014 ANKIT VERMA 86
Common Dialog Control : Folder Browser Dialog
 Folder Browser Dialog is used to select the folder.
 FolderBrowserDialog Properties & Methods:
 RootFolder
 SelectPath
 ShowNewFolderButton
 Reset
 ShowDialog
28-11-2014 ANKIT VERMA 87
Common Dialog Control : Font Dialog
 Font Dialog is similar to Font Dialog of MS Word.
 User can Select the font, style etc.
 FontDialog Properties & Methods:
 Color
 Font
 MaxSize
 MinSize
 ShowApply
 ShowColor
 ShowHelp
 Reset
 ShowDialog
28-11-2014 ANKIT VERMA 88
Color Dialog & Font Dialog : Example
 Example:
28-11-2014 ANKIT VERMA 89
Common Dialog Control
28-11-2014 ANKIT VERMA 90
Common Dialog Control :
Open File Dialog & Save File Dialog
 OpenFileDialog is used for selection of file to open.
 SaveFileDialog is used to select or specify the path of a
file in which current document will be saved.
 Properties & Methods:
 AddExtension
 DefaultExt
 FileName
 Filter
 MultiSelect
28-11-2014 ANKIT VERMA 91
 OpenFile
 Reset
 ShowDialog
 ShowReadOnly
 Show Help
Folder Browser Dialog : Example
 Example:
28-11-2014 ANKIT VERMA 92
28-11-2014 ANKIT VERMA 93
Creating User Controls
Creating User Controls
 All windows form controls are reusable components
and they are used for window based application.
 We can create our own control other than existing.
 We can combine existing & our own custom control.
 Two main classes used for creating custom controls:
 Control Class
 Provide all basic functionality for the windows user.
 Handles user input through keyboard, mouse etc.
 User Class
 It is inherited child of control class.
 Provide empty control that can be used to create other control.
28-11-2014 ANKIT VERMA 94
Creating User Controls : Types Of Controls
 There are three types of controls that can be created:
 Composite Control
 It is collection of Windows Form controls contained in single
container.
 Also called Constituent Controls.
 Extended Control
 In this, we derive an inherited control from the existing one.
 In this approach, we can retain all the functionality of parent control
and extend those functionality by adding our own custom properties
& methods.
 Custom Control
 This is new control from the beginning by inheriting from Control
Class.
28-11-2014 ANKIT VERMA 95
Creating User Controls : Example
 Creating User Control (Button):
28-11-2014 ANKIT VERMA 96
Creating User Controls : Example
 Import User Control (Button):
28-11-2014 ANKIT VERMA 97
Creating User Controls : Example
28-11-2014 ANKIT VERMA 98
Creating User Controls : Example
28-11-2014 ANKIT VERMA 99
Creating User Controls : Example
28-11-2014 ANKIT VERMA 100
28-11-2014 ANKIT VERMA 101
OBJECT ORIENTED
CONCEPTS
Object Oriented Concepts
 VB.NET is an Object Oriented Programming language
with features:
 Abstraction
 Encapsulation
 Polymorphism
 Inheritance
 It also support following:
 Overloading
 Overriding
 Structure
 Class
28-11-2014 ANKIT VERMA 102
Class
 Class is generally called a Blueprint or User Defined
Data Type.
 Class is collection of objects of similar type.
 Class consists of Attributes (Data Members) and
Behaviors (Member Functions), that are used by
Instances of that class.
 Class is an Abstract entity.
 Members of Class:
 Data Members, Properties, Methods & Events
 Class Access Specifiers:
 Public, Private, Protected, Friend & Protected Friend
28-11-2014 ANKIT VERMA 103
Object
 Objects are Real Time entity.
 They may present as Person, Place, Bank Account, Table of
Data, Item etc.
 It is Instance of class.
 Each object contain data & code to manipulate data.
 Two types of data members:
 Static or Class Member
 Members that apply to Class and called by their class names.
 Shared keyword is used with members.
 Instance or Object Member
 Members that apply to object.
 They referred by object name.
28-11-2014 ANKIT VERMA 104
Overloading & Overriding
 Overloading
 Provide different versions of a method that has same name &
different parameters.
 Parameters can be different from name, data type or ordering of
parameters.
 Overriding
 Replace inherited property or method.
 Overridden methods in subclass must be same as base class
method including name and parameters.
28-11-2014 ANKIT VERMA 105
Class Object Example
 Example:
28-11-2014 ANKIT VERMA 106
Constructor
 Special methods that allow control over initialization
of objects.
 Constructors are Procedures with name Sub New.
 Run when Instance of class is created.
 Explicitly called only from other Constructors.
 Parameterized Constructors:
 Parameters can be passed to constructors also.
 Shared Constructors can’t have parameters.
28-11-2014 ANKIT VERMA 107
Constructor Types
 Two types of Constructors:
 Shared Constructors
 Used to initialize Shared variables.
 Created using Shared keyword & shared with all instance of class.
 Not run more than one, during single execution of program.
 Explicitly Public access & we can’t write explicitly.
 We can’t initialize Instance variable in Constructor.
 Instance Constructors
 Initialize variable that are declared with Dim, Public, Private,
Friend, Protected etc.
 You can also access Shared variable within this.
28-11-2014 ANKIT VERMA 108
Constructor Example
28-11-2014 ANKIT VERMA 109
Destructor
 Special method used to release Objects from memory.
 Two types of Destructors:
 Finalize Method
 Called from the class or derived class, to which it belong.
 Called after last reference to an Object is released from Memory.
 .NET automatically runs Finalize Destructor.
 We can’t determine it’s execution, when an Object loses its scope.
 CLR calls this using system call called Garbage Collection.
 CLR periodically check for Object, if Object not used, this Destructor
is called automatically and Garbage Collection Starts.
 Finalize method is Overridden when we write our code Explicitly.
 Dispose
28-11-2014 ANKIT VERMA 110
Destructor
 Dispose Method
 Problem with Finalize Method is non deterministic nature.
 We can’t determine Finalize Method call explicitly.
 Dispose Method is called to release resource such as Database
Connection, File Handler or System Lock.
 Unlike Finalize Method, this is not called Automatically.
 Through code we have to call this Explicitly.
28-11-2014 ANKIT VERMA 111
 Example:
Protected Overrides Sub Finalize ( )
MsgBox (“Object Out Of Scope”)
EndSub
Structure
 It is User Defined Data Type.
 Structure combines Variables & Methods.
 Single Variable of Structure can hold different types of data.
 Structure can be declared Inside Class, Namespace, Module
or Another Structure.
 Access Specifiers are allowed for Structure & their members.
 Only Shared Members & Constants can be Initialized.
 Like Class, Structure have Constructors but only
parameterized.
 If we have Default Constructor, that must be declared as Shared one.
28-11-2014 ANKIT VERMA 112
Structure Example
 Example:
28-11-2014 ANKIT VERMA 113
Structure With Constructor Example
 Example:
28-11-2014 ANKIT VERMA 114
Class VS Structure
 Similarities:
 Both are User Defined Data Types.
 Both support members like Constructor, Variables, Constants,
Methods, Events etc.
 Both have Shared Constructors with or without parameters.
 Both can implement Interfaces.
28-11-2014 ANKIT VERMA 115
Class vs Structure
 Differences:
 Class can be Inherited from other Class, but Structure not.
 Class can have Instance Constructors with and without
parameters, but Structure only have parameterized.
 Class is Reference type, but Structure is Value type.
 Class allow initialization of members inside Class, but Structure
not allow inside initialization.
 Class have Private as default Access Specifier for all variables &
constants, but Structure have Public by default.
 Class Procedures can handle Events, but not in Structure.
28-11-2014 ANKIT VERMA 116
28-11-2014 ANKIT VERMA 117
Method Overloaing
Method Overloading
 Overloading Methods have same name, but different
argument lists.
 Argument may differ in Type, Number or Order Of
The Parameter.
 Return type of Overloading Method can be Same or
Different.
 Method invoked depends upon the type of argument
passed.
 Overloading is example of Polymorphism.
28-11-2014 ANKIT VERMA 118
Method Overloading : Example
28-11-2014 ANKIT VERMA 119
28-11-2014 ANKIT VERMA 120
Shared Members
Shared Members
 Shared keyword can be used with Constructor,
Methods & Variables.
 Shared methods can be overloaded like regular
methods.
 Shared variables create only one copy for all instances
of class.
28-11-2014 ANKIT VERMA 121
Shared Members : Example
 Example:
28-11-2014 ANKIT VERMA 122
28-11-2014 ANKIT VERMA 123
Inheritance
Inheritance
 Inheritance refers to deriving new Class from existing Class.
 Derived Class is known as Sub Class and Parent Class is
known as Base Class.
 Derived Class inherits all Public & Protected Data Members,
Methods, Events & Constants.
 Constructor can’t be inherited.
 Types of Inheritance:
 Single
 Multi Level
 Hierarchical
 Multiple Inheritance only supported by using Interface
28-11-2014 ANKIT VERMA 124
Inheritance : Keywords
 Inherits
 Inherits keyword is used to inherit Class.
 MustInherit
 Indicate that Class must be inherited by other Class.
 It act as Base Class and similar to Abstract Class of Java.
 NonInheritable
 If class is marked NonInheritable, we can’t create its Sub Class
 MyBase
 Call parent Class Constructor and Parent Class Overridden Methods.
 It always refers the immediate Super Class.
 We can’t navigate to more than one level from the Child Class.
 MyBase.MethodName is not allowed in .NET
28-11-2014 ANKIT VERMA 125
Inheritance : Keywords
 Overloads
 Indicate that methods are Overloading.
 If Methods are in same class, no necessary to write this keyword.
 Overridable
 Allow method to be Overridden.
 Overrides keyword is used to override the Overridable Method.
 NotOverridable
 Prevent the method being Overridden.
 MustOverride
 Methods must be declared in MultiInherit Class.
 MustInherit
 Enable Abstract Class creation. Child Class must implement all Abstract
Methods, otherwise Child Class also must declared as Abstract Class.
28-11-2014 ANKIT VERMA 126
Inheritance : Example
 Example:
28-11-2014 ANKIT VERMA 127
Inheritance : Example
28-11-2014 ANKIT VERMA 128
Inheritance : Example
28-11-2014 ANKIT VERMA 129
28-11-2014 ANKIT VERMA 130
Method Overriding
Method Overriding
 Sub Class is not only Inheriting but it can also give its
own implementation (override) for methods.
 All the methods can’t be Overridden.
 To allow methods to Overridden, Parent Class method
must use Overridable keyword.
28-11-2014 ANKIT VERMA 131
Method Overriding : Example
28-11-2014 ANKIT VERMA 132
28-11-2014 ANKIT VERMA 133
Abstract
Base Class
Abstract Base Class
 MustInherit keyword is used to create Abstract Class.
 Contain Signature of method, that Derived Class can
implement in its own Class.
 We can’t create Object of it.
 Method with MustOverride keyword should not
contain any implementation.
 Class with even one MustOverride method, should be
declared as MustInherit.
 To implement method, Overrides keyword use in Sub
Class.
28-11-2014 ANKIT VERMA 134
Abstract Base Class
 If Sub Class is not implementing any one of Abstract
methods from Abstract Class, then Child Class must
be declared as Abstract one.
 Abstract Class can contain Non-Abstract Method also.
28-11-2014 ANKIT VERMA 135
Abstract Base Class : Example
 Example:
28-11-2014 ANKIT VERMA 136
28-11-2014 ANKIT VERMA 137
Interface
Interface
 Interface defines Properties, Method and Events, called
members of Interface.
 Interface consist of only Declaration of Members but not
the Implementation.
 Only Class and Structure implement these data
members.
 Variables can’t be declared in the Interface.
 Single Class can inherit from only one Base Class, but
can implement any number of Interfaces.
 It support Multiple Inheritance.
 Implements keyword is used for their implementation.
28-11-2014 ANKIT VERMA 138
Interface Vs Class
 Interface can’t provide any implementation, whereas
Class can provide implementation to Methods.
 Interface can’t have Constructors, but Class can define
Constructors.
 A Class inherits from only one Class, but implements
multiple Interface.
28-11-2014 ANKIT VERMA 139
Interface : Example
 Example:
28-11-2014 ANKIT VERMA 140
THANKYOU
P R E S E N T A T I O N B Y :
A N K I T V E R M A
( I T D E P A R T M E N T )
DOUBTS
A N K I T V E R M A A S S T . P R O F E S S O R

More Related Content

What's hot

Visusual basic
Visusual basicVisusual basic
Visusual basic
Mandavi Classes
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
Salim M
 
Visual basic
Visual basicVisual basic
Visual basic
umesh patil
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0sanket1996
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
francopw
 
Introduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 Fundamentals
Sanay Kumar
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
Anjan Mahanta
 
Visual programming lecture
Visual programming lecture Visual programming lecture
Visual programming lecture
AqsaHayat3
 
Visual basic
Visual basicVisual basic
Visual basic
sanjay joshi
 
visual basic programming
visual basic programmingvisual basic programming
visual basic programming
sowndaryadharmaraj
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0Aarti P
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingAbha Damani
 
Visual basic 6 black book
Visual basic 6 black bookVisual basic 6 black book
Visual basic 6 black bookAjay Goyal
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Visual programming
Visual programmingVisual programming
Visual programming
Dr. C.V. Suresh Babu
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 

What's hot (20)

Visusual basic
Visusual basicVisusual basic
Visusual basic
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
 
Visual basics
Visual basicsVisual basics
Visual basics
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
 
Visual basic
Visual basicVisual basic
Visual basic
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
 
Introduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 Fundamentals
 
Vb basics
Vb basicsVb basics
Vb basics
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Visual programming lecture
Visual programming lecture Visual programming lecture
Visual programming lecture
 
Visual basic
Visual basicVisual basic
Visual basic
 
Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
 
visual basic programming
visual basic programmingvisual basic programming
visual basic programming
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Visual basic 6 black book
Visual basic 6 black bookVisual basic 6 black book
Visual basic 6 black book
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Visual programming
Visual programmingVisual programming
Visual programming
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 

Similar to BCA IPU VB.NET UNIT-III

Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshopdhi her
 
Ide and datatypes vb-net-u-ii-p2
Ide and datatypes  vb-net-u-ii-p2Ide and datatypes  vb-net-u-ii-p2
Ide and datatypes vb-net-u-ii-p2
Prachi Sasankar
 
object oriented fundamentals in vb.net
object oriented fundamentals in vb.netobject oriented fundamentals in vb.net
object oriented fundamentals in vb.net
bantamlak dejene
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
bantamlak dejene
 
AWT information
AWT informationAWT information
AWT information
Unit Nexus Pvt. Ltd.
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
AdiseshaK
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
Prof. Dr. K. Adisesha
 
2 front panel
2  front panel2  front panel
2 front panel
Ankush Jamthikar
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
JOSEPHINEA6
 
Introduction to UiAutomation EMEA APAC.pdf
Introduction to UiAutomation EMEA APAC.pdfIntroduction to UiAutomation EMEA APAC.pdf
Introduction to UiAutomation EMEA APAC.pdf
Cristina Vidu
 
Visual basic
Visual basicVisual basic
Visual basic
Alisha Korpal
 
ApplicationTestPlan[1]
ApplicationTestPlan[1]ApplicationTestPlan[1]
ApplicationTestPlan[1]Minu Mishra
 
06 win forms
06 win forms06 win forms
06 win forms
mrjw
 
VISUAL PROGRAMMING
VISUAL PROGRAMMINGVISUAL PROGRAMMING
VISUAL PROGRAMMING
SarithaDhanapal
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
gebrsh
 
Notes windows form controls gui applications
Notes windows form controls   gui applicationsNotes windows form controls   gui applications
Notes windows form controls gui applications
William Olivier
 
ITE 1122_ AWT and SWING.pptx
ITE 1122_ AWT  and SWING.pptxITE 1122_ AWT  and SWING.pptx
ITE 1122_ AWT and SWING.pptx
udithaisur
 
From Design to UML to Working Wireframe
From Design to UML to Working WireframeFrom Design to UML to Working Wireframe
From Design to UML to Working Wireframe
UX Antwerp Meetup
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
Prachi Sasankar
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
AnasYunusa
 

Similar to BCA IPU VB.NET UNIT-III (20)

Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
 
Ide and datatypes vb-net-u-ii-p2
Ide and datatypes  vb-net-u-ii-p2Ide and datatypes  vb-net-u-ii-p2
Ide and datatypes vb-net-u-ii-p2
 
object oriented fundamentals in vb.net
object oriented fundamentals in vb.netobject oriented fundamentals in vb.net
object oriented fundamentals in vb.net
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
 
AWT information
AWT informationAWT information
AWT information
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
 
2 front panel
2  front panel2  front panel
2 front panel
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
Introduction to UiAutomation EMEA APAC.pdf
Introduction to UiAutomation EMEA APAC.pdfIntroduction to UiAutomation EMEA APAC.pdf
Introduction to UiAutomation EMEA APAC.pdf
 
Visual basic
Visual basicVisual basic
Visual basic
 
ApplicationTestPlan[1]
ApplicationTestPlan[1]ApplicationTestPlan[1]
ApplicationTestPlan[1]
 
06 win forms
06 win forms06 win forms
06 win forms
 
VISUAL PROGRAMMING
VISUAL PROGRAMMINGVISUAL PROGRAMMING
VISUAL PROGRAMMING
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Notes windows form controls gui applications
Notes windows form controls   gui applicationsNotes windows form controls   gui applications
Notes windows form controls gui applications
 
ITE 1122_ AWT and SWING.pptx
ITE 1122_ AWT  and SWING.pptxITE 1122_ AWT  and SWING.pptx
ITE 1122_ AWT and SWING.pptx
 
From Design to UML to Working Wireframe
From Design to UML to Working WireframeFrom Design to UML to Working Wireframe
From Design to UML to Working Wireframe
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 

Recently uploaded

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 

BCA IPU VB.NET UNIT-III

  • 1. FEDT VB.NET F R O N T E N D D E S I G N T O O L U S I N G V B . N E T P R E S E N T A T I O N B Y : A N K I T V E R M A ( I T D E P A R T M E N T ) A N K I T V E R M A A S S T . P R O F E S S O R U N I T - 3
  • 2. Interface  User interacts with application using well-defined user interface.  Two types of interface:  CUI (Character User Interface)  Commands for user interaction  Not much user friendly  E.g. Console Application  GUI (Graphical User Interface)  No need to remember commands  Very easy to use & user friendly  E.g. Windows Application 28-11-2014 ANKIT VERMA 2
  • 3. 28-11-2014 ANKIT VERMA 3 WINDOWS FORMS
  • 4. Windows Form  Accept input from user & display information.  Develop desktop based application.  Provides full support of database connectivity & image formats.  System.Windows.Forms namespace support Form Class.  Title Bar, Menu Bar & Control Box are at top of form.  Main area is called Client Area, surrounded by border.  Form associated controls enriched with predefined Properties, Methods & Events. 28-11-2014 ANKIT VERMA 4
  • 5. Windows Form  Properties  Define characteristics of controls like color, size, border etc.  Methods  Methods are defined by the action that an object can perform.  Events  These are actions that can be recognized by the objects.  Event occur when the user, OS or application interact with objects of program.  They control the appearance & behavior of a form either at design time or run time. 28-11-2014 ANKIT VERMA 5
  • 6. Windows Form: Properties & Methods  Backcolor  BackgroundImage  FormBorderStyle  None  Fixed Single  Sizeable  Fixed Dialog  Fixed 3D  Fixed Tool Window  Sizeable Tool Window  MaximizeBox 28-11-2014 ANKIT VERMA 6
  • 7. Windows Form: Properties & Methods  MaximizeBox  MinimizeBox  Text  WindowState  StartPosition  CenterParent  Manual  CenterScreen  WindowDefaultBounds  WindowDefaultLocation 28-11-2014 ANKIT VERMA 7
  • 8. Windows Form: Properties & Methods  Activate  Close  Show  Refresh  Hide  Dispose 28-11-2014 ANKIT VERMA 8
  • 9. Windows Form : Example  Example 1: 28-11-2014 ANKIT VERMA 9
  • 10. Windows Form : Example  Example 2: 28-11-2014 ANKIT VERMA 10
  • 11. Windows Form: Events  Activated  Deactivate  Click  Load  Closing  Closed 28-11-2014 ANKIT VERMA 11
  • 12. MDI Forms  Display multiple windows at same time.  MDI form act as parent form or container for all other forms, called MDI parent form.  Contain Menu Bar, Tool Bar and Status Bar.  E.g. Word  By default, VB.NET support SDI application, where only one window displayed at a time.  E.g. Wordpad  In MDI Application, child forms are displayed as independent windows under parent MDI window. 28-11-2014 ANKIT VERMA 12
  • 13. MDI Forms  Create a form & set IsMDIContainer property true, it will act as container.  Attach the menus to MIDI parent form.  Click event of menu item, write: Form2.Show()  Add one more Form to project.  Write code on load of Second Form: Me.MdiParent = Form1  Run the code & click on menu item. 28-11-2014 ANKIT VERMA 13
  • 15. 28-11-2014 ANKIT VERMA 15 CONTROLS
  • 16. Controls  Major controls are:  Label  Linklabel  Textbox  Button  Checkbox  Listbox  Radiobutton  Combobox  Groupbox  Hscrollbar 28-11-2014 ANKIT VERMA 16  Vscrollbar  Picturebox  Timer  ListView  TreeView  Panel  ToolBar  StatusBar
  • 17. Controls : Properties & Methods  Properties & Methods of controls are:  Backcolor  Forecolor  Size  Enable  Locked  Visible  Location  Font  Maximum Size  Minimum Size 28-11-2014 ANKIT VERMA 17  Hide  Show  Select  Refresh
  • 19. Label  Graphic control used to display text.  User can’t edit text directly.  Text properties can be set at Run Time / Design Time.  It is in System.Windows.Form.Label class.  Label can’t receive focus.  Label Properties are:  AutoSize  BorderStyle  Enabled  Text Align  Text 28-11-2014 ANKIT VERMA 19
  • 20. Label : Example  Example: 28-11-2014 ANKIT VERMA 20
  • 22. Textbox  Accept input from user & retrieve data from database.  Textbox can be Multiline, Editable or ReadOnly.  It is subclass of System.Windows.Forms.TextBoxBase Class. 28-11-2014 ANKIT VERMA 22
  • 23. Textbox : Properties & Methods  Textbox Properties & Methods:  Borderstyle  MaxLength  PasswordChar  ReadOnly  MultiLine  Textbox Events:  GotFocus  LostFocus  Click  TextChanged  KeyPress 28-11-2014 ANKIT VERMA 23  ScrollBars  SelectedText  TextAlign  WordWrap  AppendText  Text  Clear  Select  SelectAll  Show  Cut  Copy  Paste
  • 24. Textbox : Example  Example: 28-11-2014 ANKIT VERMA 24
  • 25. 28-11-2014 ANKIT VERMA 25 Link Label
  • 26. Link Label  Used to support hyperlinks.  Derived from Label class.  Link Label Properties:  ActiveLinkColor  LinkColor  VisitedLinkColor  LinkVisited  Link Label Event:  LinkClicked 28-11-2014 ANKIT VERMA 26
  • 27. Link Label : Example  Example: 28-11-2014 ANKIT VERMA 27
  • 29. Button  Buttons are the controls which are used for click even.  Button Properties:  Text  BackgroundImage  ImageAlign  TextAlign  Button Event:  Click 28-11-2014 ANKIT VERMA 29
  • 30. 28-11-2014 ANKIT VERMA 30 Radio Button & Check Box
  • 31. Radio Button  Radio button is used to select any one option at time.  These buttons are working in a group.  GroupBox control is used to group the related controls together.  If we select a radio button from the group, the other buttons can’t be select from the same group. 28-11-2014 ANKIT VERMA 31
  • 32. Radio Button : Properties & Event  Radio Button Properties:  Text  AutoCheck  Radio Button Event:  Click 28-11-2014 ANKIT VERMA 32
  • 33. CheckBox  Checkbox is used to set yes/no or true/false options.  User can select one option at a time.  When we select a checkbox, a right mark appears in it, indicating that the box is selected.  The image and text both can be displayed in the CheckBox control. 28-11-2014 ANKIT VERMA 33
  • 34. CheckBox : Properties & Event  CheckBox Properties:  Text  AutoCheck  Checked  ThreeState  CheckState  CheckBox Event:  CheckedChanged 28-11-2014 ANKIT VERMA 34
  • 35. RadioButton & CheckBox : Example  Example: 28-11-2014 ANKIT VERMA 35
  • 36. RadioButton & CheckBox : Example 28-11-2014 ANKIT VERMA 36
  • 37. RadioButton & CheckBox : Example 28-11-2014 ANKIT VERMA 37
  • 38. RadioButton & CheckBox : Example 28-11-2014 ANKIT VERMA 38
  • 39. 28-11-2014 ANKIT VERMA 39 List Box & Combo Box
  • 40. ListBox  Display list of items to user.  User can select one or more items from list box.  Scroll bar appears automatically if the list has too many items.  User can add items to control using Design Time or Run Time. 28-11-2014 ANKIT VERMA 40
  • 41. ListBox : Properties & Events  ListBox Properties:  SelectionMode  Sorted  SelectedIndex  SelectedItem  MultiColumn  Items  Add  ListBox Event:  SelectedIndexChanged 28-11-2014 ANKIT VERMA 41  Clear  Contains  Insert  IndexOf  Remove  RemoveAt
  • 42. ComboBox  It is used to display a drop down list of items.  It is combination of a textbox in which user enters an item & drop down list from which user selects an item. 28-11-2014 ANKIT VERMA 42
  • 43. ComboBox : Properties & Events  ComboBox Properties:  Sorted  MaxLength  SelectedIndex  SelectedItem  Items  Text  Add  ComboBox Event:  SelectedIndexChanged 28-11-2014 ANKIT VERMA 43  Clear  Contains  Insert  IndexOf  Remove  RemoveAt
  • 44. ListBox & ComboBox : Example  Example: 28-11-2014 ANKIT VERMA 44
  • 45. ListBox & ComboBox : Example 28-11-2014 ANKIT VERMA 45
  • 46. ListBox & ComboBox : Example 28-11-2014 ANKIT VERMA 46
  • 47. 28-11-2014 ANKIT VERMA 47 Picture Box & Timer Control
  • 48. PictureBox  Used to display images, handling images, editing images.  Image can be added at Run Time as well as at Design Time.  PictureBox Properties & Methods:  Image  BorderStyle  SizeMode  Load  PictureBox Event:  MouseDown 28-11-2014 ANKIT VERMA 48
  • 49. Timer Control  Used to create periodic events.  This control is not visible at Run Time.  It work behind the scenes.  TimerControl Properties & Methods:  Enable  Interval  Start  Stop  TimerControl Event:  Tick 28-11-2014 ANKIT VERMA 49
  • 50. PictureBox & Timer Control : Example  Example: 28-11-2014 ANKIT VERMA 50
  • 51. PictureBox & Timer Control : Example 28-11-2014 ANKIT VERMA 51
  • 52. PictureBox & Timer Control : Example 28-11-2014 ANKIT VERMA 52
  • 53. 28-11-2014 ANKIT VERMA 53 HScrollBar & VScrollBar
  • 54. HScrollBar & VScrollBar  Scroll Bars are Vertical & Horizontal controls that display a Srcoll Box or Thumb that we can manipulate.  The value of Scroll Bar changes when we drag the Thumb into new position.  ScrollBar Properties:  Value  Minimum  Maximum  LargeChange  SmallChange  ScrollBar Event  ScrollValueChanged: 28-11-2014 ANKIT VERMA 54
  • 55. HScrollBar : Example  Example: 28-11-2014 ANKIT VERMA 55
  • 57. Panel  Panel is used to group other controls.  It divide the form into different regions.  Panel Control have scrollbars.  Panel Control Properties:  AutoScroll  BorderStyle 28-11-2014 ANKIT VERMA 57
  • 60. Menus  Provide consistent way to group commands so that user can access them very easily.  MenuScript control is used to create menus.  Menus are user friendly and interactive.  Menu Item Properties:  Checked  DisplayStyle  Enable  ShortCutKeys  Visible 28-11-2014 ANKIT VERMA 60
  • 62. 28-11-2014 ANKIT VERMA 62 Exception Handling
  • 63. Exception Handling : Types  Types of Exception Handling  Structured Exception Handling  Structured Exception Handling is included in VB.NET  E.g. When we open a file & file not exist, exception raised and handled by system itself.  Un-structured Exceptional Handling  Un-structured Exceptional Handling of Visual Basic is still supported in VB.NET.  Exception class in system namespace is base class of all Exceptions. 28-11-2014 ANKIT VERMA 63
  • 64. Exception Handling : Error Types  Three types of Errors:  Syntax  Appear when we write the wrong Syntax.  Easily fixed in .NET  Runtime  Appear only when we Compile & Run the code.  Logical  Appear when we use the application, but producing wrong result. 28-11-2014 ANKIT VERMA 64
  • 65. Exception Handling : System Defined  System defined exceptions are:  Exception  Index Out Of Range Exception  Null Reference Exception  Argument Exception  Arithmetic Exception 28-11-2014 ANKIT VERMA 65
  • 66. Exception Handling : Syntax  Syntax: Try Catch [exception as type] Catch [exception as type] Finally [finally statement] End Try 28-11-2014 ANKIT VERMA 66
  • 68. User Defined Exception  Example: 28-11-2014 ANKIT VERMA 68
  • 69. 28-11-2014 ANKIT VERMA 69 ADVANCED CONTROLS
  • 70. 28-11-2014 ANKIT VERMA 70 List View
  • 71. List View  Used to display items.  E.g. Window Explorer right pane  User can view items in different modes:  LargeIcon  SmallIcon  List  Title  Details 28-11-2014 ANKIT VERMA 71
  • 72. List View : Properties & Methods  ListView Properties & Methods:  AllowColumnReorder  AutoArrange  CheckBoxes  Columns  GridLines  Items  LabelEdit  ListView Event:  SelectedIndexChanged 28-11-2014 ANKIT VERMA 72  MultiSelect  Sorting  View  ArrangeIcons  Clear  GetItemAt
  • 73. List View : Example  Example: 28-11-2014 ANKIT VERMA 73
  • 74. List View : Example  Example: 28-11-2014 ANKIT VERMA 74
  • 75. 28-11-2014 ANKIT VERMA 75 Tree View
  • 76. Tree View  Display hierarchy of nodes.  Each node can have child nodes also.  E.g. Window explorer leftpane 28-11-2014 ANKIT VERMA 76
  • 77. Tree View : Properties & Events  TreeView Properties & Methods:  CheckBoxes  FullRowSelcet  LabelEdit  Nodes  Scrollable  SelectedNode  GetNodeCount  TreeView Events:  AfterCollapse  BeforeCollapse 28-11-2014 ANKIT VERMA 77  ShowLines  ShowRootLines  Sorted  TopNode  CollapseAll  ExpandAll  AfterExpand  BeforeExpand
  • 78. Tree View : Example  Example: 28-11-2014 ANKIT VERMA 78
  • 80. ToolBar  Placed after menu bar & consist of buttons.  Different types of buttons can be created in toolbar.  Standard Push Button  Toggle Button  Drop Down Button  Separators  Toolbar are usually docked along the top of its parent window.  Display tool tips when the user points the mouse pointer at toolbar button. 28-11-2014 ANKIT VERMA 80
  • 81. ToolBar : Properties & Events  ToolBar Properties & Methods:  Appearance  AutoSize  Buttons  Divider  ShowToolTips  TextAlign  Wrappable  ToolBar Events:  ButtonClick 28-11-2014 ANKIT VERMA 81
  • 82. 28-11-2014 ANKIT VERMA 82 Status Bar
  • 83. StatusBar  Appear at bottom of window.  Display panels or simple status bar to display single message on bar.  StatusBar Properties & Methods:  BackgroundImage  Font  Panels  ShowPanels  StatusBar Events:  PanelClick 28-11-2014 ANKIT VERMA 83
  • 84. 28-11-2014 ANKIT VERMA 84 Common Dialog Control
  • 85. Common Dialog Control  Window application use standard dialog boxes for common operations.  These are implemented as standard control in toolbox.  They are not visible at Run Time.  Five types of dialog controls in toolbox under dialog tabs:  ColorDialog  FolderBrowserDialog  FontDialog  OpenFileDialog  SaveFileDialog 28-11-2014 ANKIT VERMA 85
  • 86. Common Dialog Control : Color Dialog  Color Dialog is for selecting colors from list of colors.  ColorDialog Properties & Methods:  Color  CustomColors  FullOpen  ShowHelp  Reset  ShowDialog 28-11-2014 ANKIT VERMA 86
  • 87. Common Dialog Control : Folder Browser Dialog  Folder Browser Dialog is used to select the folder.  FolderBrowserDialog Properties & Methods:  RootFolder  SelectPath  ShowNewFolderButton  Reset  ShowDialog 28-11-2014 ANKIT VERMA 87
  • 88. Common Dialog Control : Font Dialog  Font Dialog is similar to Font Dialog of MS Word.  User can Select the font, style etc.  FontDialog Properties & Methods:  Color  Font  MaxSize  MinSize  ShowApply  ShowColor  ShowHelp  Reset  ShowDialog 28-11-2014 ANKIT VERMA 88
  • 89. Color Dialog & Font Dialog : Example  Example: 28-11-2014 ANKIT VERMA 89
  • 91. Common Dialog Control : Open File Dialog & Save File Dialog  OpenFileDialog is used for selection of file to open.  SaveFileDialog is used to select or specify the path of a file in which current document will be saved.  Properties & Methods:  AddExtension  DefaultExt  FileName  Filter  MultiSelect 28-11-2014 ANKIT VERMA 91  OpenFile  Reset  ShowDialog  ShowReadOnly  Show Help
  • 92. Folder Browser Dialog : Example  Example: 28-11-2014 ANKIT VERMA 92
  • 93. 28-11-2014 ANKIT VERMA 93 Creating User Controls
  • 94. Creating User Controls  All windows form controls are reusable components and they are used for window based application.  We can create our own control other than existing.  We can combine existing & our own custom control.  Two main classes used for creating custom controls:  Control Class  Provide all basic functionality for the windows user.  Handles user input through keyboard, mouse etc.  User Class  It is inherited child of control class.  Provide empty control that can be used to create other control. 28-11-2014 ANKIT VERMA 94
  • 95. Creating User Controls : Types Of Controls  There are three types of controls that can be created:  Composite Control  It is collection of Windows Form controls contained in single container.  Also called Constituent Controls.  Extended Control  In this, we derive an inherited control from the existing one.  In this approach, we can retain all the functionality of parent control and extend those functionality by adding our own custom properties & methods.  Custom Control  This is new control from the beginning by inheriting from Control Class. 28-11-2014 ANKIT VERMA 95
  • 96. Creating User Controls : Example  Creating User Control (Button): 28-11-2014 ANKIT VERMA 96
  • 97. Creating User Controls : Example  Import User Control (Button): 28-11-2014 ANKIT VERMA 97
  • 98. Creating User Controls : Example 28-11-2014 ANKIT VERMA 98
  • 99. Creating User Controls : Example 28-11-2014 ANKIT VERMA 99
  • 100. Creating User Controls : Example 28-11-2014 ANKIT VERMA 100
  • 101. 28-11-2014 ANKIT VERMA 101 OBJECT ORIENTED CONCEPTS
  • 102. Object Oriented Concepts  VB.NET is an Object Oriented Programming language with features:  Abstraction  Encapsulation  Polymorphism  Inheritance  It also support following:  Overloading  Overriding  Structure  Class 28-11-2014 ANKIT VERMA 102
  • 103. Class  Class is generally called a Blueprint or User Defined Data Type.  Class is collection of objects of similar type.  Class consists of Attributes (Data Members) and Behaviors (Member Functions), that are used by Instances of that class.  Class is an Abstract entity.  Members of Class:  Data Members, Properties, Methods & Events  Class Access Specifiers:  Public, Private, Protected, Friend & Protected Friend 28-11-2014 ANKIT VERMA 103
  • 104. Object  Objects are Real Time entity.  They may present as Person, Place, Bank Account, Table of Data, Item etc.  It is Instance of class.  Each object contain data & code to manipulate data.  Two types of data members:  Static or Class Member  Members that apply to Class and called by their class names.  Shared keyword is used with members.  Instance or Object Member  Members that apply to object.  They referred by object name. 28-11-2014 ANKIT VERMA 104
  • 105. Overloading & Overriding  Overloading  Provide different versions of a method that has same name & different parameters.  Parameters can be different from name, data type or ordering of parameters.  Overriding  Replace inherited property or method.  Overridden methods in subclass must be same as base class method including name and parameters. 28-11-2014 ANKIT VERMA 105
  • 106. Class Object Example  Example: 28-11-2014 ANKIT VERMA 106
  • 107. Constructor  Special methods that allow control over initialization of objects.  Constructors are Procedures with name Sub New.  Run when Instance of class is created.  Explicitly called only from other Constructors.  Parameterized Constructors:  Parameters can be passed to constructors also.  Shared Constructors can’t have parameters. 28-11-2014 ANKIT VERMA 107
  • 108. Constructor Types  Two types of Constructors:  Shared Constructors  Used to initialize Shared variables.  Created using Shared keyword & shared with all instance of class.  Not run more than one, during single execution of program.  Explicitly Public access & we can’t write explicitly.  We can’t initialize Instance variable in Constructor.  Instance Constructors  Initialize variable that are declared with Dim, Public, Private, Friend, Protected etc.  You can also access Shared variable within this. 28-11-2014 ANKIT VERMA 108
  • 110. Destructor  Special method used to release Objects from memory.  Two types of Destructors:  Finalize Method  Called from the class or derived class, to which it belong.  Called after last reference to an Object is released from Memory.  .NET automatically runs Finalize Destructor.  We can’t determine it’s execution, when an Object loses its scope.  CLR calls this using system call called Garbage Collection.  CLR periodically check for Object, if Object not used, this Destructor is called automatically and Garbage Collection Starts.  Finalize method is Overridden when we write our code Explicitly.  Dispose 28-11-2014 ANKIT VERMA 110
  • 111. Destructor  Dispose Method  Problem with Finalize Method is non deterministic nature.  We can’t determine Finalize Method call explicitly.  Dispose Method is called to release resource such as Database Connection, File Handler or System Lock.  Unlike Finalize Method, this is not called Automatically.  Through code we have to call this Explicitly. 28-11-2014 ANKIT VERMA 111  Example: Protected Overrides Sub Finalize ( ) MsgBox (“Object Out Of Scope”) EndSub
  • 112. Structure  It is User Defined Data Type.  Structure combines Variables & Methods.  Single Variable of Structure can hold different types of data.  Structure can be declared Inside Class, Namespace, Module or Another Structure.  Access Specifiers are allowed for Structure & their members.  Only Shared Members & Constants can be Initialized.  Like Class, Structure have Constructors but only parameterized.  If we have Default Constructor, that must be declared as Shared one. 28-11-2014 ANKIT VERMA 112
  • 114. Structure With Constructor Example  Example: 28-11-2014 ANKIT VERMA 114
  • 115. Class VS Structure  Similarities:  Both are User Defined Data Types.  Both support members like Constructor, Variables, Constants, Methods, Events etc.  Both have Shared Constructors with or without parameters.  Both can implement Interfaces. 28-11-2014 ANKIT VERMA 115
  • 116. Class vs Structure  Differences:  Class can be Inherited from other Class, but Structure not.  Class can have Instance Constructors with and without parameters, but Structure only have parameterized.  Class is Reference type, but Structure is Value type.  Class allow initialization of members inside Class, but Structure not allow inside initialization.  Class have Private as default Access Specifier for all variables & constants, but Structure have Public by default.  Class Procedures can handle Events, but not in Structure. 28-11-2014 ANKIT VERMA 116
  • 117. 28-11-2014 ANKIT VERMA 117 Method Overloaing
  • 118. Method Overloading  Overloading Methods have same name, but different argument lists.  Argument may differ in Type, Number or Order Of The Parameter.  Return type of Overloading Method can be Same or Different.  Method invoked depends upon the type of argument passed.  Overloading is example of Polymorphism. 28-11-2014 ANKIT VERMA 118
  • 119. Method Overloading : Example 28-11-2014 ANKIT VERMA 119
  • 120. 28-11-2014 ANKIT VERMA 120 Shared Members
  • 121. Shared Members  Shared keyword can be used with Constructor, Methods & Variables.  Shared methods can be overloaded like regular methods.  Shared variables create only one copy for all instances of class. 28-11-2014 ANKIT VERMA 121
  • 122. Shared Members : Example  Example: 28-11-2014 ANKIT VERMA 122
  • 123. 28-11-2014 ANKIT VERMA 123 Inheritance
  • 124. Inheritance  Inheritance refers to deriving new Class from existing Class.  Derived Class is known as Sub Class and Parent Class is known as Base Class.  Derived Class inherits all Public & Protected Data Members, Methods, Events & Constants.  Constructor can’t be inherited.  Types of Inheritance:  Single  Multi Level  Hierarchical  Multiple Inheritance only supported by using Interface 28-11-2014 ANKIT VERMA 124
  • 125. Inheritance : Keywords  Inherits  Inherits keyword is used to inherit Class.  MustInherit  Indicate that Class must be inherited by other Class.  It act as Base Class and similar to Abstract Class of Java.  NonInheritable  If class is marked NonInheritable, we can’t create its Sub Class  MyBase  Call parent Class Constructor and Parent Class Overridden Methods.  It always refers the immediate Super Class.  We can’t navigate to more than one level from the Child Class.  MyBase.MethodName is not allowed in .NET 28-11-2014 ANKIT VERMA 125
  • 126. Inheritance : Keywords  Overloads  Indicate that methods are Overloading.  If Methods are in same class, no necessary to write this keyword.  Overridable  Allow method to be Overridden.  Overrides keyword is used to override the Overridable Method.  NotOverridable  Prevent the method being Overridden.  MustOverride  Methods must be declared in MultiInherit Class.  MustInherit  Enable Abstract Class creation. Child Class must implement all Abstract Methods, otherwise Child Class also must declared as Abstract Class. 28-11-2014 ANKIT VERMA 126
  • 127. Inheritance : Example  Example: 28-11-2014 ANKIT VERMA 127
  • 130. 28-11-2014 ANKIT VERMA 130 Method Overriding
  • 131. Method Overriding  Sub Class is not only Inheriting but it can also give its own implementation (override) for methods.  All the methods can’t be Overridden.  To allow methods to Overridden, Parent Class method must use Overridable keyword. 28-11-2014 ANKIT VERMA 131
  • 132. Method Overriding : Example 28-11-2014 ANKIT VERMA 132
  • 133. 28-11-2014 ANKIT VERMA 133 Abstract Base Class
  • 134. Abstract Base Class  MustInherit keyword is used to create Abstract Class.  Contain Signature of method, that Derived Class can implement in its own Class.  We can’t create Object of it.  Method with MustOverride keyword should not contain any implementation.  Class with even one MustOverride method, should be declared as MustInherit.  To implement method, Overrides keyword use in Sub Class. 28-11-2014 ANKIT VERMA 134
  • 135. Abstract Base Class  If Sub Class is not implementing any one of Abstract methods from Abstract Class, then Child Class must be declared as Abstract one.  Abstract Class can contain Non-Abstract Method also. 28-11-2014 ANKIT VERMA 135
  • 136. Abstract Base Class : Example  Example: 28-11-2014 ANKIT VERMA 136
  • 137. 28-11-2014 ANKIT VERMA 137 Interface
  • 138. Interface  Interface defines Properties, Method and Events, called members of Interface.  Interface consist of only Declaration of Members but not the Implementation.  Only Class and Structure implement these data members.  Variables can’t be declared in the Interface.  Single Class can inherit from only one Base Class, but can implement any number of Interfaces.  It support Multiple Inheritance.  Implements keyword is used for their implementation. 28-11-2014 ANKIT VERMA 138
  • 139. Interface Vs Class  Interface can’t provide any implementation, whereas Class can provide implementation to Methods.  Interface can’t have Constructors, but Class can define Constructors.  A Class inherits from only one Class, but implements multiple Interface. 28-11-2014 ANKIT VERMA 139
  • 140. Interface : Example  Example: 28-11-2014 ANKIT VERMA 140
  • 141. THANKYOU P R E S E N T A T I O N B Y : A N K I T V E R M A ( I T D E P A R T M E N T ) DOUBTS A N K I T V E R M A A S S T . P R O F E S S O R