Selasa, 30 September 2014

“Latihan 7 Visual Basic” dengan Visual Basic 6.0

VB6SP6_logo

“Latihan 7 Visual Basic” yang terdapat pada blog Yulis Riyadi.

Tidak ada modifikasi yang dibuat. Hanya sekedar menambahkan fungsi berindex pada perintah tombol. Untuk lebih lengkapnya dapat dilihat pada kode sumber yang disertakan.

 

 

Struktur_Looping

VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Struktur Looping"
ClientHeight = 3735
ClientLeft = 45
ClientTop = 375
ClientWidth = 4590
BeginProperty Font
Name = "Segoe UI"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3735
ScaleWidth = 4590
StartUpPosition = 2 'CenterScreen
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 375
Left = 0
TabIndex = 6
Top = 3360
Visible = 0 'False
Width = 4590
_ExtentX = 8096
_ExtentY = 661
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.CommandButton Command1
Caption = "Keluar"
Height = 495
Index = 4
Left = 240
TabIndex = 5
Top = 3000
Width = 4095
End
Begin VB.CommandButton Command1
Caption = "Do While"
Height = 495
Index = 3
Left = 2640
TabIndex = 4
Top = 2160
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "Do Until"
Height = 495
Index = 2
Left = 2640
TabIndex = 3
Top = 1560
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "For Next 2"
Height = 495
Index = 1
Left = 2640
TabIndex = 2
Top = 840
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "For Next 1"
Height = 495
Index = 0
Left = 2640
TabIndex = 1
Top = 240
Width = 1695
End
Begin VB.ListBox List1
Height = 2535
Left = 240
TabIndex = 0
Top = 240
Width = 2175
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click(Index As Integer)
Dim i%
Select Case Index
Case 0:
List1.Clear
For i = 1 To 100
List1.AddItem "Angka " & i
Next
Case 1:
List1.Clear
For i = 100 To 1 Step -2
List1.AddItem "Angka " & i
Next
Case 2:
List1.Clear
i = Asc("A")
Do Until i > Asc("Z")
List1.AddItem "Huruf " & Chr(i)
i = i + 1
Loop
Case 3:
List1.Clear
i = Asc("Z")
Do While i >= Asc("A")
List1.AddItem "Huruf " & Chr(i)
i = i - 1
Loop
Case 4:
Dim Respon
Respon = MsgBox("Keluar program ?", _
vbQuestion + vbYesNo, _
"Perhatian")
If Respon = vbYes Then
End
End If
End Select
End Sub


Unduh Kode Sumber

0 Komentar:

Posting Komentar

Berlangganan Posting Komentar [Atom]

<< Beranda