This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Tampilkan postingan dengan label Tips & Triks. Tampilkan semua postingan
Tampilkan postingan dengan label Tips & Triks. Tampilkan semua postingan

Jumat, 21 Maret 2014

Membuat kalkulator sederhana VB6

Postingan kali ini tentang membuat kalkulator sederhana menggunakan VB6,Guna memenuhi tugas saat kuliah pemrograman 1.Berikut kita liat priviewnya :


Berikut apasaja objek dan propertiesnya :








Dan berikut ini source codenya :

Dim inAngka(0 To 1), Opr

Private Sub cbAngka_Click(Index As Integer)
    txthasil.Text = txthasil.Text + cbAngka(Index).Caption
End Sub

Private Sub cbClear_Click()
    txthasil.Text = ""
End Sub

Private Sub cbKoma_Click()
    If txthasil.Text <> "" Then
        txthasil.Text = txthasil.Text + ","
    End If
End Sub

Private Sub cbOpr_Click(Index As Integer)
    If txthasil.Text <> "" Then
    inAngka(0) = CSng(txthasil.Text)
    Opr = cbOpr(Index).Caption
    txthasil.Text = ""
    Else
        psn = MsgBox("Masukkan Angka Terlebih Dahulu!", vbCritical, "Warning!")
    End If
End Sub

Private Sub cbPlusMinus_Click()
    txthasil.Text = txthasil.Text * (-1)
End Sub

Private Sub cbProses_Click()

        inAngka(1) = CSng(txthasil.Text)
    
        Select Case Opr
            Case "*"
                total = inAngka(0) * inAngka(1)
            Case "/"
                total = inAngka(0) / inAngka(1)
            Case "+"
                total = inAngka(0) + inAngka(1)
            Case "-"
                total = inAngka(0) - inAngka(1)
        End Select
    
        txthasil.Text = total
End Sub

Sekian postingan kali ini,apabila ada salah penulisan saya mohon maaf,..^_^