Concatenating two strings
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Button1.Click
Label3.Text = "My Full Name is" + TextBox1.Text + " " + TextBox2.Text
End Sub
Write a program to find number is odd or even in Vb
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click
Dim num As Integer
num = TextBox1.Text
If num Mod 2 = 0 Then
Label2.Text = TextBox1.Text + " " + "is Even."
Else
Label2.Text = TextBox1.Text + " " + "is odd."
End If
End Sub
Write a program to find a square root program in Vb
Private Sub Command1_Click()
Dim Num as Interger
Num = Val ( Text1.Text)
Num = Num * Num
Text2.Text = Format $ ( Num )
End Sub
Write a program for change a color background in Vb
Private Sub C1_Click()
Form1.Backcolor = VbRed
End Sub
Private Sub C2_Click()
Form1.Backcolor = VbGreen
End Sub
Private Sub C3_Click()
Form1.Backcolor = VbBlack
End Sub
Private Sub C4_Click()
Form1.Backcolor = VbBlue
End Sub