You are on page 1of 10

Practical 1, Qn11

Public Class Form1


Dim a As Integer
Dim b As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
a = Convert.ToInt32(TextBox1.Text)
b = Convert.ToInt32(TextBox2.Text)

If a >= b Then
Label3.Text = "A is the greater No."
Else
Label3.Text = "B is the greater No."
End If
End Sub
End Class

Page no 23
Public Class Form1
Dim a, b, c As Integer

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


a = Convert.ToInt32(TextBox1.Text)
b = Convert.ToInt32(TextBox2.Text)
c = Convert.ToInt32(TextBox3.Text)
If a > b Then
If a > c Then
Label4.Text = "a is greater"
Else
Label4.Text = "c is greater"
End If
Else
If b > c Then
Label4.Text = "b is greater"
Else
Label4.Text = "a is greater"
End If
End If

End Sub
End Class

Page No 24
Public Class Form1
Dim a As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
a = Convert.ToInt32(TextBox1.Text)

If a >= 40 Then
If a >= 40 And a < 60 Then
Label2.Text = "Pass Class"
ElseIf a >= 60 And a < 75 Then
Label2.Text = "First Class"
Else
Label2.Text = "Distinction"

End If
Else
Label2.Text = "Fail"
End If

End Sub
End Class

Page 26
Practical 5 Qn.14.1
Public Class Form1

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


BackColor = Color.White
End Sub

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


BackColor = Color.Red
End Sub

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


BackColor = Color.Blue
End Sub

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


BackColor = Color.Yellow
End Sub

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


BackColor = Color.Orange
End Sub

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click


BackColor = Color.Pink

End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click


BackColor = Color.Purple
End Sub

Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click


BackColor = Color.Black
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub
End Class

Page no 53

Public Class Form1

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


ComboBox1.Items.Add(TextBox1.Text)
End Sub

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


ComboBox1.Items.Remove("Rohit")
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ListBox1.Items.Add(TextBox1.Text)

End Sub

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


ListBox1.Items.RemoveAt(0)

End Sub
End Class

Page no. 63
Practical 5 Qn.14.2 page 31
Inheritance
Module Program

'Dim c, d As Integer
Public Class a
Public c, d As Integer
Public Sub add()

Console.WriteLine("Enter the first no :")


c = Console.ReadLine()
Console.WriteLine("Enter the second no :")
d = Console.ReadLine()
End Sub
End Class
Public Class b
Inherits a
Public Sub result()
Dim sum As Integer
sum = c + d
Console.WriteLine("Sum of two number is :{0}", sum)
End Sub
End Class

Public Class obj


Public Shared Sub Main(ByVal args As String())
Dim b As b = New b()
b.add()
b.result()
End Sub
End Class
End Module

You might also like