VB .NET Unit-3
VB .NET Unit-3
NET
FRONT END DESIGN TOOL
USING
VB .NET
UNIT - 3
PRESENTATION BY:
ANKIT VERMA
(IT DEPARTMENT)
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.
Backcolor
BackgroundImage
FormBorderStyle
None
Fixed Single
Sizeable
Fixed Dialog
Fixed 3D
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
Example 1:
Example 2:
Activated
Deactivate
Click
Load
Closing
Closed
Hscrollbar
Forecolor Show
Size Select
Enable Refresh
Locked
Visible
Location
Font
Maximum Size
Minimum Size
BorderStyle
Enabled
Text Align
Text
28-11-2014 ANKIT VERMA 19
Label : Example
Example:
LostFocus
Click
TextChanged
KeyPress
28-11-2014 ANKIT VERMA 23
Textbox : Example
Example:
LinkColor
VisitedLinkColor
LinkVisited
Example:
Buttons are the controls which are used for click even.
Button Properties:
Text
BackgroundImage
ImageAlign
TextAlign
Button Event:
Click
AutoCheck
CheckBox Properties:
Text
AutoCheck
Checked
ThreeState
CheckState
CheckBox Event:
CheckedChanged
Example:
ListBox Properties:
SelectionMode Clear
Sorted Contains
SelectedIndex Insert
SelectedItem IndexOf
MultiColumn Remove
Items RemoveAt
Add
ListBox Event:
SelectedIndexChanged
ComboBox Properties:
Sorted Clear
MaxLength Contains
SelectedIndex Insert
SelectedItem IndexOf
Items Remove
Text RemoveAt
Add
ComboBox Event:
SelectedIndexChanged
Example:
Interval
Start
Stop
TimerControl Event:
Tick
Example:
Minimum
Maximum
LargeChange
SmallChange
ScrollBar Event
ScrollValueChanged:
28-11-2014 ANKIT VERMA 54
HScrollBar : Example
Example:
BorderStyle
Example:
Example:
Runtime
Appear only when we Compile & Run the code.
Logical
Appear when we use the application, but producing wrong result.
Argument Exception
Arithmetic Exception
Syntax:
Try
Catch [exception as type]
Catch [exception as type]
Finally
[finally statement]
End Try
Example:
Example:
SmallIcon
List
Title
Details
ListView Event:
SelectedIndexChanged
Example:
Example:
FullRowSelcet ShowRootLines
LabelEdit Sorted
Nodes TopNode
Scrollable CollapseAll
SelectedNode ExpandAll
GetNodeCount
TreeView Events:
AfterCollapse AfterExpand
BeforeCollapse BeforeExpand
Example:
Toggle Button
Separators
AutoSize
Buttons
Divider
ShowToolTips
TextAlign
Wrappable
ToolBar Events:
ButtonClick
CustomColors
FullOpen
ShowHelp
Reset
ShowDialog
SelectPath
ShowNewFolderButton
Reset
ShowDialog
Font
MaxSize
MinSize
ShowApply
ShowColor
ShowHelp
Reset
ShowDialog
Example:
Example:
User Class
It is inherited child of control class.
Provide empty control that can be used to create other control.
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
Overriding
Structure
Class
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.
Example:
Instance Constructors
Initialize variable that are declared with Dim, Public, Private,
Friend, Protected etc.
You can also access Shared variable within this.
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.
Example:
Protected Overrides Sub Finalize ( )
MsgBox (“Object Out Of Scope”)
EndSub
Example:
Example:
Similarities:
Both are User Defined Data Types.
Differences:
Class can be Inherited from other Class, but Structure not.
Example:
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.
We can’t navigate to more than one level from the Child Class.
Overloads
Indicate that methods are Overloading.
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:
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.
Example:
Example:
DOUBTS
PRESENTATION BY:
ANKIT VERMA
(IT DEPARTMENT)