Option Explicit
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = FormUtama.Top
Me.Left = FormUtama.Width + FormUtama.Left + 10
Dim nama, kelas, alamat, lahir As String
Dim bar As Integer
Dim tinggi
tinggi = Text_nama(1).Height + 20
bar = 1
Label5.Alignment = 2
Open "datasiswa.txt" For Input As #1
Do While Not EOF(1)
Input #1, nama, kelas, alamat, lahir
If bar = 1 Then
Text_nama(1).Text = nama
Text_kelas(1).Text = kelas
Text_alamat(1).Text = alamat
Text_lahir(1).Text = lahir
End If
If bar > 1 Then
Load Text_nama(bar)
Text_nama(bar).Visible = True
Text_nama(bar).Left = Text_nama(bar - 1).Left
Text_nama(bar).Top = Text_nama(bar - 1).Top + tinggi
Text_nama(bar).Text = nama '&H00C0E0FF&
Load Text_kelas(bar)
Text_kelas(bar).Visible = True
Text_kelas(bar).Left = Text_kelas(bar - 1).Left
Text_kelas(bar).Top = Text_kelas(bar - 1).Top + tinggi
Text_kelas(bar).Text = kelas
Load Text_alamat(bar)
Text_alamat(bar).Visible = True
Text_alamat(bar).Left = Text_alamat(bar - 1).Left
Text_alamat(bar).Top = Text_alamat(bar - 1).Top + tinggi
Text_alamat(bar).Text = alamat
Load Text_lahir(bar)
Text_lahir(bar).Visible = True
Text_lahir(bar).Left = Text_lahir(bar - 1).Left
Text_lahir(bar).Top = Text_lahir(bar - 1).Top + tinggi
Text_lahir(bar).Text = lahir
Load No(bar)
No(bar).Visible = True
No(bar).Left = No(bar - 1).Left
No(bar).Top = No(bar - 1).Top + tinggi
No(bar).Caption = bar
End If
If bar Mod 2 = 0 Then
Text_nama(bar).BackColor = &H8000000F '&HC0E0FF
Text_kelas(bar).BackColor = &H8000000F '&HC0E0FF
Text_alamat(bar).BackColor = &H8000000F '&HC0E0FF
Text_lahir(bar).BackColor = &H8000000F '&HC0E0FF
End If
bar = bar + 1
Loop
Close #1
Me.Height = 1500 + Text_nama(bar - 1).Top
Command1.Top = Text_nama(bar - 1).Top + 500
End Sub