"Dream,Believe and Make It Happen!"

Rabu, 26 April 2017

Tutorial Setting Mikrotik

1.
2.
3.
4. Jika muncul seperti dibawah isi dengan admin dan password dikosongkan saja.
5. Langkah pertama adalah tulis system identity
6. Untuk merubah nama router, seperti dibawah : set name=router_(nama yg kita inginkan)
7. untuk setting password: set 0 password=123456789. kita isi saja 1-9
8.
9.
10.











Tutorial Install Mikrotik di Virtual Box

Assalamualaikum semuanya :) selamat siang...kali ini aku mau kasih tutorial cara Install Mikrotik di Virtual Box. Biarpun kondisi badan sedang tidak fit karena cuaca yang gak bisa diprediksi tapi tetap semangat menjalankan aktivitas sehari hari yaa... Langsung aja yuk....

1. Langkah pertama yg harus anda lakukan adalah mendownload terlebih dahulu mikrotiknya, caranya buka link ( www.routeros.co.id )

2. Selanjutnya pilih versi 5.26

3. Lalu pilih mikrotik-5.26.iso setelah itu klik download.
4. Setelah selesai mendownload, buka Virtual Box anda.

5. pilih baru/new


6. isi nama partisi nya. Disini saya menggunakan ( mikrotik-neng ) sesuai dengan nama saya :)
7. klik lanjut

8. Pilih buat hard disk virtual sekarang. Lalu pilih Buat.

 9.Pilih VDI (Virtual Disk Image), lalu Next/Lanjut.



10.Langkah selanjutnya pilih Dialokasikan secara unik, lalu Next


 11. Lalu browse file mikrotik yg tadi anda download. Pastikan sudah terpilih, lalu klik Mulai.






anda telah berhasil menginstall mikrotik di virtual box. Untuk Tutorial selanjutnya :
- system identity router
- interface : eth1_ISP
- user : buat user dan password anda
- ip address
- ip router
- ip dns\
akan saya post di postingan saya selanjutnya....

Senin, 10 April 2017

Tugas Input Box, Procedure, Function



KODINGNYA :

Public Class Form1
    Dim jk As String
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        ListBox1.Items.Remove(ListBox1.SelectedItem)
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        nonaktif()

    End Sub

    Sub nonaktif()
        Label1.Text = "Nama Lengkap"
        Label2.Text = "Tempat Tanggal Lahir"
        RadioButton1.Text = "Laki Laki"
        RadioButton2.Text = "Perempuan"
        Label3.Text = "Jenis Kelamin"
        Label4.Text = "Alamat"
        Label5.Text = "Nama Orangtua"
        Label6.Text = "Tinggi Badan"
        Label7.Text = "Usia"
        Label8.Text = "Berat Badan"
        Label9.Text = "Riwayat Penyakit"
        Label10.Text = ""
        Label11.Text = ""
        Label12.Text = ""
        Label13.Text = ""
        Label14.Text = ""
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        Button1.Text = "Tambah"
        Button2.Text = "Simpan"
        Button3.Text = "Hapus"
        Button4.Text = "Bersih"
        Button5.Text = "Tambah Data"
        TextBox1.Enabled = False
        TextBox2.Enabled = False
        DateTimePicker1.Enabled = False
        RadioButton1.Enabled = False
        RadioButton2.Enabled = False
        TextBox3.Enabled = False
        TextBox4.Enabled = False
        Button5.Enabled = False
    End Sub

    Sub aktif()
        TextBox1.Enabled = True
        TextBox2.Enabled = True
        DateTimePicker1.Enabled = True
        RadioButton1.Enabled = True
        RadioButton2.Enabled = True
        TextBox3.Enabled = True
        TextBox4.Enabled = True
        Button5.Enabled = True
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        aktif()
    End Sub

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        Dim a As Integer
        Label10.Text = InputBox("Masukan tinggi badan anda")
        Label11.Text = InputBox("Masukan usia anda")
        Label12.Text = InputBox("Masukan berat badan anda")
        Label13.Text = InputBox("Riwayat Penyakit")
        a = ket(Label10.Text, Label12.Text)
        If a = 0 Then
            Label14.Text = "LULUS"
            Button2.Enabled = True
        ElseIf a = 1 Then
            Label14.Text = "TIDAK LULUS"
            Button2.Enabled = False
        End If
    End Sub

    Function ket(ByVal a As Integer, ByVal b As Integer)
        If a >= 180 And b <= 80 Then
            ket = 0
        Else
            ket = 1
        End If
    End Function

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If RadioButton1.Checked = True Then
            jk = "Laki Laki"
        ElseIf RadioButton2.Checked = True Then
            jk = "Perempuan"
        End If

        With ListBox1
            .Items.Add(TextBox1.Text)
            .Items.Add(TextBox2.Text)
            .Items.Add(DateTimePicker1.Text)
            .Items.Add(jk)
            .Items.Add(TextBox3.Text)
            .Items.Add(TextBox4.Text)
            .Items.Add(Label10.Text)
            .Items.Add(Label11.Text)
            .Items.Add(Label12.Text)
            .Items.Add(Label13.Text)
        End With

        nonaktif()
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        ListBox1.Items.Clear()
    End Sub

    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
        nonaktif()
    End Sub
End Class


Tugas Enable Disable


KODINGNYA :

Public Class Form1
    Dim tawar, isi, kering As String
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "Atas Nama :"
        Label2.Text = "Minuman Pendamping :"
        Button1.Text = "OK"
        Button2.Text = "Pesan"
        Button3.Text = "Hapus salah satu Menu"
        Button4.Text = "Hapus Semua Menu"
        CheckBox1.Text = "Roti Tawar"
        CheckBox2.Text = "Roti Isi"
        CheckBox3.Text = "Roti Kering"

        With Me.ComboBox1
            .Items.Add("Kopi")
            .Items.Add("Teh")
            .Items.Add("Ice Cream")
        End With

        With Me.ComboBox3
            .Items.Add("Original")
            .Items.Add("Gandum")
            .Items.Add("Pandan")
            .Items.Add("Kismis")
        End With

        With Me.ComboBox4
            .Items.Add("Roti isi Keju")
            .Items.Add("Roti isi Blueberry")
            .Items.Add("Roti isi Strawberry")
            .Items.Add("Roti isi Cokelat")
        End With

        With Me.ComboBox5
            .Items.Add("Semprit")
            .Items.Add("Nastar")
            .Items.Add("Kastengel")
            .Items.Add("Putri Salju")
        End With

        ComboBox1.Enabled = False
        ComboBox3.Enabled = False
        ComboBox4.Enabled = False
        ComboBox5.Enabled = False

        If CheckBox1.Checked = True Then
            ComboBox3.Enabled = True
        Else
            ComboBox3.Enabled = False
        End If

        If CheckBox2.Checked = True Then
            ComboBox4.Enabled = True
        Else
            ComboBox4.Enabled = False
        End If

        If CheckBox3.Checked = True Then
            ComboBox5.Enabled = True
        Else
            ComboBox5.Enabled = False
        End If
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        MsgBox("Anda ingin menambahkan Minuman Pendamping")
        ComboBox1.Enabled = True
    End Sub

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
        ComboBox3.Enabled = True
    End Sub

    Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
        ComboBox4.Enabled = True
    End Sub

    Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
        ComboBox5.Enabled = True
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If CheckBox1.Checked = True Then
            tawar = "Tawar"
        Else : tawar = ""
        End If

        If CheckBox2.Checked = True Then
            isi = "Isi"
        Else : isi = ""
        End If

        If CheckBox3.Checked = True Then
            kering = "Kering"
        Else : kering = ""
        End If
        ListBox1.Items.Add("Atas Nama :" & TextBox1.Text)
        ListBox1.Items.Add("Minuman Pendamping :" & ComboBox1.Text)
        ListBox1.Items.Add(tawar)
        ListBox1.Items.Add(ComboBox3.Text)
        ListBox1.Items.Add(isi)
        ListBox1.Items.Add(ComboBox4.Text)
        ListBox1.Items.Add(kering)
        ListBox1.Items.Add(ComboBox5.Text)

    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        MsgBox("Anda akan Menghapus salah satu menu pesanan")
        ListBox1.Items.Remove(ListBox1.SelectedItem)
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        MsgBox("Anda akan menghapus semua menu pesanan")
        ListBox1.Items.Clear()
    End Sub

    Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter

    End Sub
End Class


Tugas MDI


KODINGNYA :

Public Class Form1

    Private Sub PenjualanToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PenjualanToolStripMenuItem.Click
        Form2.Show()
        Form2.MdiParent = Me
    End Sub

    Private Sub CloseToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CloseToolStripMenuItem.Click
        Close()
    End Sub
End Class






Public Class Form2
    Dim total, harga As Integer
    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "Jenis"
        Label2.Text = "Merk"
        Label3.Text = "Harga"
        Label4.Text = "Jumlah Beli"
        Label5.Text = "Total Harga"
        Button1.Text = "OK"
        ComboBox1.Items.Add("BAJU")
        ComboBox1.Items.Add("CELANA")
        ComboBox1.Items.Add("JAKET")
        Me.ContextMenuStrip = ContextMenuStrip1
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
        ComboBox2.Items.Clear()

        Select Case ComboBox1.Text
            Case "BAJU"
                ComboBox2.Items.Add("RA JEANS")
                ComboBox2.Items.Add("BLACK ID")
                ComboBox2.Items.Add("CROOZ")
            Case "CELANA"
                ComboBox2.Items.Add("JEANS")
                ComboBox2.Items.Add("JOGGER")
                ComboBox2.Items.Add("CARGO")
            Case "JAKET"
                ComboBox2.Items.Add("ARMY")
                ComboBox2.Items.Add("SWEATER")
                ComboBox2.Items.Add("BLEAZER")
        End Select
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
        Select Case ComboBox2.Text
            Case "RA JEANS"
                TextBox1.Text = 100000
            Case "BLACK ID"
                TextBox1.Text = 200000
            Case "CROOZ"
                TextBox1.Text = 150000
            Case "JEANS"
                TextBox1.Text = 300000
            Case "JOGGER"
                TextBox1.Text = 150000
            Case "CARGO"
                TextBox1.Text = 200000
            Case "ARMY"
                TextBox1.Text = 400000
            Case "SWEATER"
                TextBox1.Text = 350000
            Case "BLEAZER"
                TextBox1.Text = 250000
        End Select
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox3.Text = (TextBox1.Text * TextBox2.Text)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs)
       
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub YaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles YaToolStripMenuItem.Click
        ComboBox1.Text = ""
        ComboBox2.Text = ""
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
    End Sub
End Class

Tugas Looping


KODINGNYA :

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "S/D"
        Label2.Text = "Kalikan Berapa ?"
        RadioButton1.Text = "Tunggal"
        RadioButton2.Text = "Sampai"
        Button1.Text = "OK"
        Button2.Text = "Add"
        Button3.Text = "Close"
        Button4.Text = "Clear"
        nonaktif()
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If RadioButton2.Checked = True Then
            Dim A, B, C As Integer
            ListBox1.Items.Clear()
            For A = TextBox1.Text To TextBox2.Text
                For B = 1 To TextBox3.Text
                    C = A * B
                    If A = 1 Then
                        ListBox1.Items.Add(A & "x" & B & "=" & C)
                    ElseIf A = 2 Then
                        ListBox1.Items.Add(A & "x" & B & "=" & C)
                    Else
                        ListBox1.Items.Add(A & "x" & B & "=" & C)
                    End If
                Next
                ListBox1.Items.Add("--------------")
            Next

        ElseIf RadioButton1.Checked = True Then

            Dim A, B, C As Integer
            ListBox1.Items.Clear()
            For A = 1 To TextBox3.Text
                For B = 1 To TextBox3.Text
                    C = A * B
                    If A = 1 Then
                        ListBox1.Items.Add(A & "x" & B & "=" & C)
                    ElseIf A = 2 Then
                        ListBox1.Items.Add(A & "x" & B & "=" & C)
                    Else
                        ListBox1.Items.Add(A & "x" & B & "=" & C)
                    End If
                Next
                ListBox1.Items.Add("--------------")
            Next
        End If
    End Sub

    Function hit(ByVal a As Integer, ByVal b As Integer)
        Dim has As Integer
        has = a * b
        Return (has)
    End Function
    Sub aktif()
        TextBox1.Enabled = True
        TextBox2.Enabled = True
        TextBox3.Enabled = True
        Button1.Enabled = True
    End Sub
    Sub nonaktif()
        TextBox1.Enabled = False
        TextBox2.Enabled = False
        TextBox3.Enabled = False
        Button1.Enabled = False
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        aktif()
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        MsgBox("Keluar yaa hehe^^")
        Close()
    End Sub
    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        ListBox1.Items.Clear()
        TextBox1.Clear()
        TextBox2.Clear()
        TextBox3.Clear()
    End Sub
    Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter

    End Sub
End Class


STUDI KASUS 2 VISUAL STUDIO 2015



KODINGNYA :


Public Class Form1
    Dim hewan, buah As Integer
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Then
            TextBox1.Text = ""
            TextBox1.Focus()
            MsgBox("Anda belum memasukan Inputan pertama")
        ElseIf TextBox2.Text = "" Then
            TextBox2.Text = ""
            TextBox2.Focus()
            MsgBox("Anda belum memasukan Inputan kedua")
        Else

            If TextBox1.Text = "Macan Tutul" Or TextBox1.Text = "Kanguru" Or TextBox1.Text = "Landak" Or TextBox1.Text = "Gajah" Or TextBox1.Text = "Buaya" Then
                hewan = 1
            ElseIf TextBox1.Text = "Nanas" Or TextBox1.Text = "Manggis" Or TextBox1.Text = "Anggur" Or TextBox1.Text = "Durian" Or TextBox1.Text = "Apel" Then
                hewan = 2
            End If
            If TextBox2.Text = "Macan Tutul" Or TextBox2.Text = "Kanguru" Or TextBox2.Text = "Landak" Or TextBox2.Text = "Gajah" Or TextBox2.Text = "Buaya" Then
                buah = 1
            ElseIf TextBox2.Text = "Nanas" Or TextBox2.Text = "Manggis" Or TextBox2.Text = "Anggur" Or TextBox2.Text = "Durian" Or TextBox2.Text = "Apel" Then
                buah = 2
            End If
        End If

        If hewan = 1 And buah = 1 Then
            MsgBox("Keduanya adalah hewan", MsgBoxStyle.Information)
        ElseIf hewan = 2 And buah = 2 Then
            MsgBox("Keduanya adalah buah", MsgBoxStyle.Information)
        ElseIf hewan <> buah Then
            MsgBox("Keduanya tidak sebanding karena keduanya berbeda", MsgBoxStyle.Critical)
            TextBox1.Text = ""
            TextBox2.Text = ""
            TextBox1.Focus()
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Clear()
        TextBox2.Clear()
    End Sub
End Class


STUDI KASUS 1 VISUAL STUDIO 2015



KODINGNYA :

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "APLIKASI PERHITUNGAN"
        Label3.Text = ""
        Label2.Text = ""
        RadioButton1.Text = "Penjumlahan"
        RadioButton2.Text = "Pengurangan"
        RadioButton3.Text = "Perkalian"
        RadioButton4.Text = "Pembagian"
        Button1.Text = "="
        Button2.Text = "Tambah Data Baru"
        Button3.Text = "Close"
    End Sub

    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged

    End Sub

    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged

    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged

    End Sub

    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim nil1 As Integer
        Dim nil2 As Integer
        Dim hasil As Integer
        nil1 = Val(TextBox1.Text)
        nil2 = Val(TextBox2.Text)
        hasil = Val(Label3.Text)
        If TextBox1.Text = "" Then
            TextBox1.Focus()
            MsgBox("anda belum memasukan nilai")
        ElseIf TextBox2.Text = "" Then
            TextBox2.Focus()
            MsgBox("anda belum memasukan nilai")
        Else

            If RadioButton1.Checked = True Then
                hasil = nil1 + nil2
                Label3.Text = hasil
                Label2.Text = "+"
                ListBox1.Items.Clear()
                ListBox1.Items.Add("----Hasil Pertambahan Adalah----")
                ListBox1.Items.Add("nilai pertama yg anda input" & TextBox1.Text)
                ListBox1.Items.Add("nilai kedua yg anda input" & TextBox2.Text)
                ListBox1.Items.Add("hasilnya" & hasil)
            End If
            If RadioButton2.Checked = True Then
                hasil = nil1 - nil2
                Label3.Text = hasil
                Label2.Text = "-"
                ListBox1.Items.Clear()
                ListBox1.Items.Add("----Hasil Pengurangan Adalah----")
                ListBox1.Items.Add("nilai pertama yg anda input" & TextBox1.Text)
                ListBox1.Items.Add("nilai kedua yg anda input" & TextBox2.Text)
                ListBox1.Items.Add("hasilnya" & hasil)
            End If
            If RadioButton3.Checked = True Then
                hasil = nil1 * nil2
                Label3.Text = hasil
                Label2.Text = "x"
                ListBox1.Items.Clear()
                ListBox1.Items.Add("----Hasil Perkalian Adalah----")
                ListBox1.Items.Add("nilai pertama yg anda input" & TextBox1.Text)
                ListBox1.Items.Add("nilai kedua yg anda input" & TextBox2.Text)
                ListBox1.Items.Add("hasilnya" & hasil)
            End If
            If RadioButton4.Checked = True Then
                hasil = nil1 / nil2
                Label3.Text = hasil
                Label2.Text = "/"
                ListBox1.Items.Clear()
                ListBox1.Items.Add("----Hasil Pembagian Adalah----")
                ListBox1.Items.Add("nilai pertama yg anda input" & TextBox1.Text)
                ListBox1.Items.Add("nilai kedua yg anda input" & TextBox2.Text)
                ListBox1.Items.Add("hasilnya" & hasil)


            End If
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        ListBox1.Items.Clear()
        Label1.Text = "APLIKASI PERHITUNGAN"
        Label3.Text = ""
        Label2.Text = ""
        RadioButton1.Text = "Penjumlahan"
        RadioButton2.Text = "Pengurangan"
        RadioButton3.Text = "Perkalian"
        RadioButton4.Text = "Pembagian"
        Button1.Text = "="
        Button2.Text = "Tambah Data Baru"
        TextBox1.Clear()
        TextBox2.Clear()
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Close()
    End Sub
End Class


Contoh Penggunaan Variable & Konstanta pada Visual Studio 2015



KODINGNYA :

Module Module1

    Sub Main()
        Dim A As String
        Dim B As Integer
        Dim c
        Const Nama As String = "Eneng Siti Patimah"
        Const tlhr As Integer = 200698

        A = "Neng"
        B = 201605
        c = "siapakah anda"
        Console.WriteLine(A)
        Console.WriteLine(B)
        Console.WriteLine(c)
        Console.WriteLine(Nama)
        Console.WriteLine(tlhr)
        Console.ReadLine()

    End Sub

End Module


Contoh Penggunaan Procedure pada Visual Studio 2015



KODINGNYA :

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Call pesan()
    End Sub

    Sub pesan()
        MsgBox("Anda sedang mempelajari membuat subrutin", MsgBoxStyle.Information, "pesan")
    End Sub
End Class


Contoh Penggunaan Looping pada Visual Studio 2015



KODINGNYA :

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "mulai angka"
        Label2.Text = "sampai angka"
        Button1.Text = "WHILE"
        Button2.Text = "Do while Loop"
        Button3.Text = " Do Loop Until"
        Button4.Text = "For...Next"
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim angka_awal, angka_akhir As Integer
        angka_awal = TextBox1.Text
        angka_akhir = TextBox2.Text
        ListBox1.Items.Clear()
        'belajar while
        While angka_awal < (angka_akhir + 1)
            ListBox1.Items.Add(angka_awal)
            angka_awal = angka_awal + 1
        End While
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim angka_awal, angka_akhir As Integer
        angka_awal = TextBox1.Text
        angka_akhir = TextBox2.Text
        ListBox1.Items.Clear()
        'belajar do while loop
        Do While angka_awal < (angka_akhir + 1)
            ListBox1.Items.Add(angka_awal)
            angka_awal += 1
        Loop
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim angka_awal, angka_akhir As Integer
        angka_awal = TextBox1.Text
        angka_akhir = TextBox2.Text
        ListBox1.Items.Clear()
        'belajar do loop until
        Do
            ListBox1.Items.Add(angka_awal)
            angka_awal += 1
        Loop Until angka_awal > (angka_akhir)
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Dim angka_awal, angka_akhir As Integer
        angka_awal = TextBox1.Text
        angka_akhir = TextBox2.Text
        ListBox1.Items.Clear()
        'belajar for next
        For angka_awal = angka_awal To angka_akhir
            ListBox1.Items.Add(angka_awal)
        Next
    End Sub
End Class


Contoh Penggunaan If pada Visual Studio 2015



KODINGNYA :

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles ButtonHasil.Click
        If radJml.checked = True Then
            textoutput.Text = Val(textinput1.Text) + Val(textinput2.Text)
        End If
        If radmin.checked = True Then
            TextOutput.Text = Val(textinput1.text) - Val(textinput2.text)
        End If
        If radkali.checked = True Then
            textOutput.text = Val(textinput1.text) * Val(textinput2.text)
        End If
        If radBagi.Checked = True Then
            textOutput.text = Val(textinput1.text) / Val(textinput2.text)
        End If
        If radpangkat.checked = True Then
            textoutput.Text = Val(textinput1.Text) ^ Val(textinput2.Text)
        End If
    End Sub

    Private Sub Label2_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub Label3_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub Label4_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub Label5_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub Label6_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles radjml.CheckedChanged
        Label1.Text = "+"
    End Sub

    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles radmin.CheckedChanged
        Label1.Text = "-"
    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles radkali.CheckedChanged
        Label1.Text = "x"
    End Sub

    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles radbagi.CheckedChanged
        Label1.Text = "/"
    End Sub

    Private Sub RadioButton5_CheckedChanged(sender As Object, e As EventArgs) Handles radpangkat.CheckedChanged
        Label1.Text = "^"
    End Sub
End Class


Contoh Penggunaan Group Box, Radio Button & Check Box pada Visual Studio 2015



KODINGNYA :

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label3.Text = "Membuat Style Font"
        Label2.Text = "Isikan Kalimat"
        Label1.Text = ""
        RadioButton1.Text = "Merah"
        RadioButton2.Text = "Biru"
        RadioButton3.Text = "Hijau"
        RadioButton4.Text = "Coklat"
        CheckBox1.Text = "Bold"
        CheckBox2.Text = "Italic"
        CheckBox3.Text = "StrikeOut"
        CheckBox4.Text = "Underline"
        Button1.Text = "Jalankan"
        GroupBox1.Text = "Masukan Data"
        GroupBox2.Text = "Pilihan Kata"
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Label1.Text = TextBox1.Text
    End Sub

    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
        Label1.ForeColor = Color.Chocolate
    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
        Label1.ForeColor = Color.Green
    End Sub

    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
        Label1.ForeColor = Color.Blue
    End Sub

    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
        Label1.ForeColor = Color.Red
    End Sub

    Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Underline)
    End Sub

    Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Strikeout)
    End Sub

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Bold)
    End Sub

    Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Italic)
    End Sub
End Class


Contoh Penggunaan Function pada Visual Studio 2015



KODINGNYA :

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Button1.Text = "Tekan"
        Me.ListBox1.Text = ""
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim na As Integer
        Dim nama As String
        nama = InputBox("Nama anda siapa")
        na = InputBox("Nilai dalam bentuk angka")
        ListBox1.Items.Add(nama)
        ListBox1.Items.Add("Hasil anda adalah")
        ListBox1.Items.Add(kelulusan(na))
        ListBox1.Items.Add("----------")
    End Sub
    Function kelulusan(ByVal nilai As Integer)
        If nilai >= 55 Then
            kelulusan = "LULUS"
        Else
            kelulusan = "GAGAL"
        End If
    End Function
End Class


Contoh Penggunaan Input Box pada Visual Studio 2015



KODINGNYA :

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "Nilai pertama yang anda masukan :"
        Label2.Text = ""
        Label3.Text = "Nilai kedua yang anda masukan :"
        Label4.Text = ""
        Label7.Text = "----------Hasil dari penjumlahan adalah----------"
        Label5.Text = "Hasilnya adalah"
        Label6.Text = ""
        Button1.Text = "Tekan tombol untuk memasukan angka"
        Button2.Text = "Hapus data"
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim nilai1 As Integer
        Dim nilai2 As Integer
        Dim hasil As Integer
        MsgBox("anda akan memasukan angka pertama")
        nilai1 = InputBox("yang harus anda masukan angka, bukan kata/huruf")
        Label2.Text = nilai1
        MsgBox("anda akan memasukan angka kedua")
        nilai2 = InputBox("anda akan memasukan angka kedua")
        Label4.Text = nilai2
        MsgBox("hasilnya adalah.....")
        hasil = nilai1 + nilai2
        Label6.Text = hasil
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        MsgBox("anda akan menghapus datanya kembali")
        Label1.Text = "Nilai pertama yang anda masukan :"
        Label2.Text = ""
        Label3.Text = "Nilai kedua yang anda masukan :"
        Label4.Text = ""
        Label7.Text = "----------Hasil dari penjumlahan adalah----------"
        Label5.Text = "Hasilnya adalah"
        Label6.Text = ""
        Button1.Text = "tekan tombol untuk memasukkan angka"
        Button2.Text = "Hapus Data"
    End Sub
End Class


Contoh Penggunaan Enable & Disable pada Visual Studio 2015



KODINGNYA:

Public Class Form1
    Dim hasil As Integer
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "Nilai 1"
        Label2.Text = "Nilai 2"
        Label3.Text = "Nilai 3"
        Label4.Text = "Nilai 4"
        Button1.Text = "Ok"
        Button2.Text = "Tambah"
        Button3.Text = "Kurang"
        Button4.Text = "Kali"
        Button5.Text = "Bagi"
        RadioButton1.Text = "Tambah"
        RadioButton2.Text = "Kurang"
        RadioButton3.Text = "Kali"
        RadioButton4.Text = "Bagi"

        Button2.Enabled = False
        Button3.Enabled = False
        Button4.Enabled = False
        Button5.Enabled = False

        TextBox4.Enabled = False
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        MsgBox("Anda akan menghidupkan input textnya")
        TextBox4.Enabled = True
    End Sub

    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
        Button2.Enabled = True

        Button3.Enabled = False
        Button4.Enabled = False
        Button5.Enabled = False
    End Sub

    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
        Button3.Enabled = True
        Button2.Enabled = False
        Button4.Enabled = False
        Button5.Enabled = False
    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
        Button4.Enabled = True
        Button2.Enabled = False
        Button3.Enabled = False

        Button5.Enabled = False
    End Sub

    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
        Button5.Enabled = True
        Button2.Enabled = False
        Button3.Enabled = False
        Button4.Enabled = False
    End Sub

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        MsgBox("Anda akan membagi nilainya")
        ListBox1.Items.Add("----------Hasil dari pembagian adalah----------")
        hasil = Val(TextBox1.Text) / Val(TextBox2.Text) / Val(TextBox3.Text) / Val(TextBox4.Text)
        ListBox1.Items.Add(hasil)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        MsgBox("Anda akan menjumlahkan nilainya")
        ListBox1.Items.Add("----------Hasil dari pertambahan adalah----------")
        hasil = Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text)
        ListBox1.Items.Add(hasil)
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        MsgBox("Anda akan mengurangi nilainya")
        ListBox1.Items.Add("----------Hasil dari pengurangan adalah----------")
        hasil = Val(TextBox1.Text) - Val(TextBox2.Text) - Val(TextBox3.Text) - Val(TextBox4.Text)
        ListBox1.Items.Add(hasil)
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        MsgBox("Anda akan mengalikan nilainya")
        ListBox1.Items.Add("----------Hasil dari perkalian adalah----------")
        hasil = Val(TextBox1.Text) * Val(TextBox2.Text) * Val(TextBox3.Text) * Val(TextBox4.Text)
        ListBox1.Items.Add(hasil)
    End Sub
End Class


Contoh penggunaan combo box & list box pada Visual Studio 2015


KODINGNYA:

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "pilih data yang akan dipilih"
        With Me.ComboBox1
            .Items.Add("Neng")
            .Items.Add("Ibnu")
            .Items.Add("Risang")
            .Items.Add("Dhimas")
            .Items.Add("Bangkit")
            .Items.Add("Tedja")
        End With
        Button1.Text = "Masukan Datanya"
        ListBox2.Items.Add("Nama yang akan dimasukkan")
        ListBox2.Items.Add("----------")
        Label2.Text = "Form untuk memasukan data"
        Button2.Text = "Hapus Data"
        Button3.Text = "Hapus Semua"

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        MsgBox("Anda akan memasukan datanya")
        With ListBox2
            .Items.Add(ComboBox1.Text)
        End With
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        MsgBox("Anda akan menghapus datanya")
        ListBox2.Items.Remove(ListBox2.SelectedItem)
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        MsgBox("Anda akan menghapus data semuanya")
        ListBox2.Items.Clear()
        ListBox2.Items.Add("Nama yang akan dimasukkan")
        ListBox2.Items.Add("----------")
    End Sub

End Class



Contoh Penggunaan Case & Timer Visual Studio 2015


KODINGNYA :

Public Class Form1
    Dim second As Integer
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Label1.Text = "Serial Number Software"
        Me.Label2.Text = "Semakan Serial Number"
        Me.Label3.Text = "Serial Number"
        Me.Button1.Text = "Mulai"
        Me.Button2.Text = "Hasil"
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Timer1.Start()
        Call soal()
    End Sub
    Sub soal()
        If second = 0 Then
            Dim pertanyaan As Integer
            pertanyaan = Int(Rnd() * 3)
            Select Case pertanyaan
                Case 0
                    Me.TextBox1.Text = "12312-34-4555-Aj889"
                Case 1
                    Me.TextBox1.Text = "555-ZAweR-9999-CXX-hhul"
                Case 2
                    Me.TextBox1.Text = "ssss-cccc-zzzz-loPPN"
                Case 3
                    Me.TextBox1.Text = "ooooo-oooo-4555-RtyuxD"
            End Select
        End If
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        second = second + 1
        Me.Label4.Text = second
        If second = 120 Then
            second = 0
            Me.Timer1.Stop()
            MsgBox("maaf waktu anda habis maka serial number akan otomatis berubah")
            Me.TextBox1.Text = ""
            Me.TextBox2.Text = ""
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Me.Timer1.Stop()
        If Me.TextBox1.Text = Me.TextBox2.Text Then
            MsgBox("serial sama, anda dapat mencrack softwarenya")
        Else
            MsgBox("serial salah, maka otomatis aplikasi keluar")
            Me.Close()
        End If
    End Sub
End Class