Vb.net programs
Vb.net programs
CLICKCOUNT EVENT
Form Design:
Form Design
Dim n As Integer = 0
End Sub
End Class
OUTPUT:
3.RICH TEXTBOX CONTROL
Form Design:
End If
End Sub
End If
End Sub
End Class
OUTPUT:
5. EXCEPTION HANDLING
Form Design:
Person file:
Try
p.Age = TxtAge.Text
MsgBox("New age is " + p.Age.ToString + ".")
Catch ex As InvalidCastException
MsgBox("Age must be a numeric value.")
Catch ex As ArgumentOutOfRangeException
MsgBox("Age must be between " + Person.MIN_AGE.ToString + " and " +
Person.MAX_AGE.ToString + ".")
End Try
End Sub
End Class
OUTPUT:
6. FUNCTIONS
Form Design:
Module Module1
Sub Main()
Console.WriteLine("Welcome")
Dim rect1 As New cRectangle(2, 3)
Dim cube1 As New cCube(2, 3, 4)
Console.WriteLine("Area of rectangle is " & rect1.GetArea)
Console.WriteLine("Area of cube is " & cube1.getArea)
Console.ReadLine()
End Sub
End Module
End Sub
Sub New(ByVal width As Integer, ByVal height As Integer)
_width = width
_height = height
End Sub
Function GetArea()
Return _width * _height
End Function
End Class
OUTPUT:
8. INHERITANCE
Form Design:
Output:
9. WEB APPLICATION
Form Design:
OUTPUT:
10. VALIDATION CONTROLS
Form Design:
Validation Controls:
1.Username : Requireddfilevalidator->ErrorMessage:*un is
required,Display:Dynamic,ControlToValidate:textBox1,SetFocusOn Error:True
2.Email:Rangevalidator>ErrorMessage:*invalidEmail,Display:Dynamic,ControlToValidate:Textbox2,SetFo
cusOnError:tTrue,validation expression:internet Expression
3.Password: requiredfilevalidator->ErrorMessage:*Pass is
required,Display:Dynamic,ControlToValidate:textBox3,SetFocusOnError:True,
TextBox3->TextMode:Password
4.Resetpassword: comparevalidator-
>ErrorMessage:*retypepasswordDisplay:Dynamic,ControlToValidate:TextBox4,SetFocusOnError:True,Co
ntrolToCompare:TextBox3
TextBox4->TextboxMode:password
Output:
11. REDIRECTION CONCEPT
Form Design 1:
Form 1:
Form Design2:
Form2:
Form1.GetValue = TextBox1.Text
Me.DialogResult = Windows.Forms.DialogResult.OK
End Sub
End Class
OUTPUT:
13. DATA GRID CONTROL
Form Design