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

gad_Pac_8

Uploaded by

arqamqazi549
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)
6 views

gad_Pac_8

Uploaded by

arqamqazi549
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/ 4

Practical No: 08

Name:Saad Momin EnrolmentNo:2205690315

Code:
Imports System.ComponentModel

Public Class Form1


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
DisplayName()
End Sub
Private Sub DisplayName()
TextBox1.Text = "Hello Faizan"
End Sub
End Class

Output:
Code No: 02
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim i As New Button
i.Text = "Click Me"
Me.Controls.Add(i)
End Sub
End Class

Output:

Code No: 03
Public Class Form1
Dim a As Integer

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


a = Val(TextBox1.Text) + (TextBox2.Text)
TextBox3.Text = a
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
a = Val(TextBox1.Text) - (TextBox2.Text)
TextBox3.Text = a
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click


a = Val(TextBox1.Text) * (TextBox2.Text)
TextBox3.Text = a
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click


a = Val(TextBox1.Text) / (TextBox2.Text)
TextBox3.Text = a
End Sub
End Class

Output:

Code No: 02
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.BackColor = Color.Green

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


Me.BackColor = Color.Yellow
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click


Me.BackColor = Color.Blue
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click


Me.BackColor = Color.Purple
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click


Me.BackColor = Color.Black
End Sub
End Class

Output:

You might also like