0% found this document useful (0 votes)
15 views

Experiment No

Uploaded by

shrutibelekar0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Experiment No

Uploaded by

shrutibelekar0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

EXPERIMENT NO: 1

AIM: Write a program in VB.Net to show simple message.


PROGRAM:
Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs)


Handles Button1.Click
TextBox1.Text = "Shruti first app"

End Sub
End Class

OUTPUT:
EXPERIMENT NO: 2
AIM: Write a program in VB.Net to calculate Simple interest.
PROGRAM:
Private Sub Button1_Click(sender As Object, e As EventArgs)
Handles Button1.Click
Dim amt As Integer, noy As Integer, Rate As Double, Si As
Double
amt = PA.Text
noy = d.Text
Rate = Ri.Text
Si = (amt * noy * Rate) / 100
RES.Text = Si

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs)


Handles Button2.Click
PA.Clear()
d.Clear()
Ri.Clear()
RES.Clear()
End Sub
End Class

OUTPUT:
EXPERIMENT NO: 3
AIM:Write a program in vb.net to demonstrate rich text box.
PROGRAM:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs)
Handles Button1.Click
rtbinfo.Undo()

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs)


Handles Button2.Click
rtbinfo.Cut()
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs)


Handles Button3.Click
rtbinfo.Copy()

End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs)


Handles Button4.Click
rtbinfo.Paste()

End Sub

End Class

OUTPUT:
EXPERIMENT NO: 4
AIM: Write a program in vb.net to demonstrate radio button and check box.
PROGRAM:
Public Class Form1
Private Sub C1_CheckedChanged(sender As Object, e As
EventArgs) Handles C1.CheckedChanged
TextBox1.Text = C1.Text
End Sub

Private Sub C2_CheckedChanged(sender As Object, e As


EventArgs) Handles C2.CheckedChanged
TextBox1.Text = C2.Text
End Sub

Private Sub C3_CheckedChanged(sender As Object, e As


EventArgs) Handles C3.CheckedChanged
TextBox1.Text = C3.Text
End Sub

Private Sub G1_CheckedChanged(sender As Object, e As


EventArgs) Handles G1.CheckedChanged
TextBox2.Text = G1.Text
End Sub

Private Sub G2_CheckedChanged(sender As Object, e As


EventArgs) Handles G2.CheckedChanged
TextBox2.Text = G2.Text
End Sub

Private Sub G3_CheckedChanged(sender As Object, e As


EventArgs) Handles G3.CheckedChanged
TextBox2.Text = G3.Text
End Sub
End Class

OUTPUT:
EXPERIMENT NO: 5
AIM: Write a program in VB.Net to perform arithmetic operation.
PROGRAM:
Public Class Form1
Dim P As Double
Dim Q As Double
Dim R As Double

Private Sub Button1_Click(sender As Object, e As EventArgs)


Handles Button1.Click

P = Val(TextBox1.Text)
Q = Val(TextBox2.Text)
R=P+Q
TextBox3.Text = R
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs)


Handles Button2.Click
P = Val(TextBox1.Text)
Q = Val(TextBox2.Text)
R=P-Q

TextBox3.Text = R
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs)


Handles Button3.Click
P = Val(TextBox1.Text)
Q = Val(TextBox2.Text)
R=P*Q

TextBox3.Text = R
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs)


Handles Button4.Click
P = Val(TextBox1.Text)
Q = Val(TextBox2.Text)
R=P/Q

TextBox3.Text = R
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs)
Handles Button5.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
End Sub
End Class

OUTPUT:

EXPERIMENT NO: 6
AIM:
PROGRAM:
Imports
System.Windows.Forms.VisualStyles.VisualStyleElement
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs)
Handles Button1.Click
Dim num1, num2, div As Decimal
num1 = Val(TextBox1.Text)
num2 = Val(TextBox2.Text)
On Error GoTo Handler
div = num1 / num2
TextBox3res.Text = div
Exit Sub
Handler:
MsgBox("Divided by zero Exception")
End

End Sub
End Class

OUTPUT:
EXPERIMENT NO: 7
AIM: Write a program in VB.Net to use ADO Control.
PROGRAM:
Private Sub cmdadd_Click()
Adodc1.Recordset.AddNew
End Sub

Private Sub cmdfirst_Click()


Adodc1.Recordset.MoveFirst
End Sub

Private Sub cmdnext_Click()


Adodc1.Recordset.Movenext
End Sub

Private Sub cmdprev_Click()


Adodc1.Recordset.MovePrevious
End Sub

Private Sub cmdLast_Click()


Adodc1.Recordset.MoveLast
End Sub

Private Sub cmdsave_Click()


Adodc1.Recordset.Update
End Sub
OUTPUT:
Experiment No.:8
AIM: Write a program in VB.Net to use Data Grid Control.
PROGRAM:
Private Sub DataGrid1_Click()
DataGrid1.DataSource
End Sub

Private Sub Form_Load()


Form1.BackColor = vbbrown
End Sub
OUTPUT:

You might also like