0% found this document useful (0 votes)
64 views5 pages

Activities Programming

The document describes 4 programs created with VB.NET: 1. A digital stopwatch program that tracks time and displays it in labels. 2. A simple animation program that moves a picturebox across the form using a timer. 3. A Pythagorean theorem calculator that solves for the unknown side of a right triangle given 2 known sides. 4. An audio player program that allows selecting and playing sound files using media player controls.

Uploaded by

Jeph Pedrigal
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)
64 views5 pages

Activities Programming

The document describes 4 programs created with VB.NET: 1. A digital stopwatch program that tracks time and displays it in labels. 2. A simple animation program that moves a picturebox across the form using a timer. 3. A Pythagorean theorem calculator that solves for the unknown side of a right triangle given 2 known sides. 4. An audio player program that allows selecting and playing sound files using media player controls.

Uploaded by

Jeph Pedrigal
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

Creating Digital Stopwatch

A program that can measure how long will it takes when you are doing on
something.

CODES:
Form1
Public Class Form1 [Link] = True If [Link] = "24" Then
[Link] = "0" [Link] = "0"
Private Sub Button1_Click(sender [Link] = "0" [Link] = "0"
As Object, e As EventArgs) Handles [Link] = "0" [Link] = "0"
[Link] [Link]() End If
[Link]() [Link]() If [Link] = "60" Then
[Link] = True End Sub [Link] = "0"
[Link] = True Private Sub Button4_Click(sender [Link] = "0"
[Link] = True As Object, e As EventArgs) Handles [Link] = "0"
End Sub [Link] End If
[Link]() End Sub
Private Sub Button2_Click(sender End Sub End Class
As Object, e As EventArgs) Handles Form 2
[Link]
[Link]() Private Sub Timer1_Tick(sender As Public Class Form2
[Link] = False Object, e As EventArgs) Handles
[Link] = False [Link] Private Sub Button5_Click(sender
[Link] = True [Link] = [Link] + 1 As Object, e As EventArgs) Handles
End Sub If [Link] = "60" Then [Link]
[Link] = "0" [Link]()
Private Sub Button3_Click(sender [Link] = [Link] + End Sub
As Object, e As EventArgs) Handles 1
[Link] End If Private Sub Button1_Click(sender
[Link] = As Object, e As EventArgs) Handles
[Link] + [Link] + If [Link] = "60" Then [Link]
[Link] + [Link] + [Link] = "0" [Link]()
[Link] [Link] = [Link] + [Link]()
[Link]() 1 End Sub
[Link] = False End If End Class
[Link] = False
Simple Animation Using Timer
A program that can show a simple animation just using a timer in visual basic.

Codes:

Form1
Public Class Form1

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles [Link]


[Link] = New Point([Link].X + 0, [Link].Y - 1)
If [Link].Y = 12 Then
[Link]()
[Link]()

End If
End Sub

Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]()
End Sub
End Class
Pythagoras Theorem using [Link]

A program that can calculate the specific measurement of the given right
angle triangle.

Codes:
Form1
Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


Dim a, b, c As Integer
a = Val([Link])
b = Val([Link])
c = Val([Link])

If b <> 0 And c <> 0 Then


[Link] = (b ^ 2 + c ^ 2) ^ (1 / 2)
If a <> 0 And c <> 0 Then
[Link] = (a ^ 2 + c ^ 2) ^ (1 / 2)
ElseIf a <> 0 And b <> 0 Then
[Link] = (a ^ 2 - b ^ 2) ^ (1 / 2)
End If
End If
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


[Link] = ""
[Link] = ""
[Link] = ""
End Sub
End Class
Simple Audio Player

A program that creates an audio player that can play a soundtrack using [Link].

Codes:
Form1
Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


[Link] = [Link]
[Link]()

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]()

End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]()

End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]()
End Sub
Private Sub TrackBar1_Scroll(sender As Object, e As EventArgs) Handles [Link]
[Link] = [Link]
End Sub
End Class
Photo Viewer

A program where you can view any pictures showing the location of it using [Link].

Codes:
Form1
Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]()
End Sub

Private Sub Form1_Activated(sender As Object, e As EventArgs) Handles [Link]


[Link] = "JPEG files (*.jpg)|*.jpg|PNG files(*.png)|*.png|ICO files
(*.ico)|*.ico|All files (*.*)|*.*"
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]


End Sub

Private Sub OpenFileDialog1_FileOk(sender As Object, e As [Link])


Handles [Link]
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]([Link])
End Sub
End Class

You might also like