This document provides an overview of front-end design using VB.NET. It discusses user interfaces, Windows forms, controls like labels, textboxes, buttons, and menus. It also covers concepts like MDI forms, properties, methods, and events. The document is a presentation by Ankit Verma on interface design in VB.NET, providing examples of common controls and concepts.
Download Complete Material - https://www.instamojo.com/prashanth_ns/
This VB.Net 4.0 with ADO.NET Programming contains 15 Units and each unit contains 40 to 60 slides in it.
Contents…
• Appreciate the Graphical User Interface (GUI)
• Identify the controls of GUI
• Identify the features of .NET Framework
• Use Windows project by using Visual Studio .NET integrated development environment
• Work with Windows Forms and Controls
• Perform drag-and-drop operations using clipboard
• Validate user input using controls and events
• Work with the CommonDialog class
• Create a custom dialog box
• Work with menus and MDI applications
• Work with ToolStrip control
• Identify the functionality of print components
• Identify the functionality of Crystal Reports
• Implement accessibility features in a .NET application
• Identify features of international applications
• Implement globalization and localization in a .NET application
• Create a help system using HTML Workshop
• Implement help system in .NET applications
• Work with built-in components in the .NET applications
• Work with user-defined components in the .NET applications
• Implement asynchronous programming
• Use the BackgroundWorker component
• Implement assemblies
• Implement various deployment strategies
• Use various editors in a deployment project
• Implement ClickOnce
• Configure and Secure a Windows application
ADO.NET 4.0 Architecture
• Work with XML
• Work with SQL queries
• Implement data binding to display values on the controls of a Windows form
• Filter the data to display the selected records
• Identify the connected and disconnected environment in ADO.NET
• Working in a connected environment
• Working in a disconnected environment
Download Complete Material - https://www.instamojo.com/prashanth_ns/
This VB.Net 4.0 with ADO.NET Programming contains 15 Units and each unit contains 40 to 60 slides in it.
Contents…
• Appreciate the Graphical User Interface (GUI)
• Identify the controls of GUI
• Identify the features of .NET Framework
• Use Windows project by using Visual Studio .NET integrated development environment
• Work with Windows Forms and Controls
• Perform drag-and-drop operations using clipboard
• Validate user input using controls and events
• Work with the CommonDialog class
• Create a custom dialog box
• Work with menus and MDI applications
• Work with ToolStrip control
• Identify the functionality of print components
• Identify the functionality of Crystal Reports
• Implement accessibility features in a .NET application
• Identify features of international applications
• Implement globalization and localization in a .NET application
• Create a help system using HTML Workshop
• Implement help system in .NET applications
• Work with built-in components in the .NET applications
• Work with user-defined components in the .NET applications
• Implement asynchronous programming
• Use the BackgroundWorker component
• Implement assemblies
• Implement various deployment strategies
• Use various editors in a deployment project
• Implement ClickOnce
• Configure and Secure a Windows application
ADO.NET 4.0 Architecture
• Work with XML
• Work with SQL queries
• Implement data binding to display values on the controls of a Windows form
• Filter the data to display the selected records
• Identify the connected and disconnected environment in ADO.NET
• Working in a connected environment
• Working in a disconnected environment
Chapter 1 — Introduction to Visual Basic 2010 Programming francopw
Chapter 1 provides an overview of programming with Visual Basic 2010.The chapter defines a computer program, describes the role of a developer in creating computer programs, and discusses event-driven programs that have a graphical user interface (GUI). The chapter also explains the roles of input, processing,output,and data when running a program on a computer; examines the basic arithmetic and logical operations a program can perform; and explores the use of databases and computer programming languages in general. Finally, the chapter introduces Visual Studio 2010 and the .NET 4.0 Framework, including the .NET class libraries and related features, and surveys the types of Visual Basic 2010 applications.
Introduction to Visual Basic 6.0 FundamentalsSanay Kumar
A powerpoint presentation on Intoduction To Visual Basic 6.0. This ppt contains slides on variuos topics of visual programming, IDE, and COM based Microsoft's software VB 6.0.
about visual basic
visual basic 6.0 v/s other version
visual basic programming
form in visual basic
objects in visual basic
important controls
visual basic statement
loop statement
conditional loop
do until loop
Chapter 1 — Introduction to Visual Basic 2010 Programming francopw
Chapter 1 provides an overview of programming with Visual Basic 2010.The chapter defines a computer program, describes the role of a developer in creating computer programs, and discusses event-driven programs that have a graphical user interface (GUI). The chapter also explains the roles of input, processing,output,and data when running a program on a computer; examines the basic arithmetic and logical operations a program can perform; and explores the use of databases and computer programming languages in general. Finally, the chapter introduces Visual Studio 2010 and the .NET 4.0 Framework, including the .NET class libraries and related features, and surveys the types of Visual Basic 2010 applications.
Introduction to Visual Basic 6.0 FundamentalsSanay Kumar
A powerpoint presentation on Intoduction To Visual Basic 6.0. This ppt contains slides on variuos topics of visual programming, IDE, and COM based Microsoft's software VB 6.0.
about visual basic
visual basic 6.0 v/s other version
visual basic programming
form in visual basic
objects in visual basic
important controls
visual basic statement
loop statement
conditional loop
do until loop
Lab view pdf of front panel gives information about how to design design the front panel. its completely designed by National instruments and good for beginners.
Introduction to UiAutomation EMEA APAC.pdfCristina Vidu
📕 Agenda:
Intro to Ui Automation
What is Ui Automation, Web automation
How to use the recording tool
Handling selectors in Studio
Data scraping
Screen scraping
Introduction to Excel automation
Data tables and data manipulation
Launch browser, attach browser
Demo - follow-along
Your trainers:
👨🏼💻 Dillan Hackett, UiPath MVP 2022, Partner & Director @Tquila Automation
👨🏻💻 Sean Jerome Llanto, UiPath MVP 2022, RPA Solutions Architect @Ingram Micro
👨🏻💻 Stefano Negro, UiPath MVP 2022, RPA Tech Lead @BSP Consultant
Introduction, Generations of computer, Visual Basic environment, Code window, Properties Window, IDE, Form Window, Starting an Application,Adding an Image Control, Running an Application
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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