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

Guided 1.menampilkan Message Box

The document contains code examples for creating message boxes, buttons, and a basic calculator application in Visual Basic. It also includes examples of using an LED display board to sequentially light up numbers that are stored in an array. The code demonstrates how to output values to the LED display port and loop through an array to display the stored numbers with delays between each value.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Guided 1.menampilkan Message Box

The document contains code examples for creating message boxes, buttons, and a basic calculator application in Visual Basic. It also includes examples of using an LED display board to sequentially light up numbers that are stored in an array. The code demonstrates how to output values to the LED display port and loop through an array to display the stored numbers with delays between each value.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

GUIDED

1.MENAMPILKAN MESSAGE BOX

Private Sub cmdBtn1_Click()

MsgBox ("Watashiwa Sisdig gatsukhi..^0^"), vbInformation, "Message"

End Sub

3.MEMBUAT TOMBOL JADI TIDAK TERLIHAT


Private Sub Tampil_Click()

Tekan1.Visible = True

Tekan2.Visible = True

Tekan3.Visible = True

End Sub

Private Sub Tekan1_Click()

Tekan1.Visible = False

End Sub

Private Sub Tekan2_Click()

Tekan2.Visible = False

End Sub

Private Sub Tekan3_Click()

Tekan3.Visible = False

End Sub
5.PROGRAM KALKULATOR SEDERHANA

Dim Variable1, Variable2

Private Sub Command1_Click()

Variable1 = Val(Data1.Text)

Variable2 = Val(Data2.Text)

If Option1.Value = True Then

lbl1.Caption = Variable1 + Variable2

End If

If Option2.Value = True Then

lbl1.Caption = Variable1 - Variable2


End If

If Option3.Value = True Then

lbl1.Caption = Variable1 * Variable2

End If

If Option4.Value = True Then

lbl1.Caption = Variable1 / Variable2

End If

End Sub

Private Sub Command2_Click()

End

End Sub

6.PROGRAM APLIKASI LIST

Dim data As String

Dim i As Integer
Dim x As Integer

Private Sub Command1_Click()

If (Text1.Text = "" Or Text2.Text = "" Or Combo1.ListIndex = -1) Then

MsgBox ("Lengkapi Data Anda")

Else

data = Text1.Text + " " + Text2.Text + " " + Combo1.Text

List1.AddItem (data)

MsgBox ("Sukses!")

Text1.Text = ""

Text2.Text = ""

Combo1.ListIndex = -1

End If

End Sub

Private Sub Command2_Click()

i = List1.ListIndex

If i <> -1 Then

List1.RemoveItem (i)

Text3.Text = ""

MsgBox ("Berhasil Dihapus!")

Else: MsgBox ("Pilih Item terlebih Dahulu!")

End If

End Sub
Private Sub List1_Click()

Text3.Text = List1.Text

End Sub

MENGHAPUS
1.MENGGUNAKAAN EX-01 (LED DISPLAY BOARD)

Private Sub Command1_Click()

Out &H378, &HAC

End Sub

Private Sub Command2_Click()

Out &H378, &H79

End Sub

2. MENGGUNAKAAN EX-01 (LED DISPLAY BOARD)

Dim index As Integer


Dim number(0 To 7) As Integer

Private Sub Command1_Click()

If index < 3 Then

Out &H378, number(index)

index = index + 1

Else

index = 0

End If

hp.Delay_ms 500

End Sub

Private Sub Form_Load()

number(0) = &H1

number(1) = &H8

number(2) = &H20

End Sub

B.
Dim index As Integer

Dim number(0 To 7) As Integer

Private Sub Command1_Click()

For index = 0 To 3

Out &H378, number(index)

hp.Delay_ms 500

Next

End Sub

Private Sub Form_Load()

number(0) = &H1

number(1) = &H8

number(2) = &H20

End Sub

LATIHAN

Dim index As Integer

Dim number(0 To 20) As Integer


Private Sub Command1_Click()

For index = 0 To 2

Out &H378, number(index)

hp.Delay_ms 500

Next

End Sub

Private Sub Command2_Click()

For index = 3 To 5

Out &H378, number(index)

hp.Delay_ms 500

Next

End Sub

Private Sub Command3_Click()

For index = 6 To 13

Out &H378, number(index)

hp.Delay_ms 500

Next

For index = 13 To 6 Step -1

Out &H378, number(index)

hp.Delay_ms 500

Next

End Sub
Private Sub Form_Load()

number(0) = &H7A

number(1) = &HB4

number(2) = &HE6

number(3) = &HBD

number(4) = &HCF

number(5) = &H9A

number(6) = &H1

number(7) = &H2

number(8) = &H4

number(9) = &H8

number(10) = &H10

number(11) = &H20

number(12) = &H40

number(13) = &H80

End Sub

You might also like