Recent post
Archive for Juni 2013
Nah pada postingan kali ini kita akan mencoba mebuat sebuah kalkulator Cinta dengan Visual Basic 2008. Oh iya kalkulator ini fungsinya untuk menghitung kira-kira seberapa besarkah cinta si dia padamu lho!!!. He he he …jangan ditanggapi serius ya. Program ini hanya untuk iseng-iseng aja, tapi lumayan lah untuk sekedar main-main ….. Nah berikut ini tampilannya kalau sudah jadi :
Berikut ini langkah-langkah membuat kalkulator cinta dengan Visual Basic 2008 :
1. Pastikan PC anda telah terinstal Microsoft Visual Basic 2008
2. Lalu buka Start-Progam-Microsoft Visual Basic 2008 Express Edition
3. Akan ada Tampilan utama, klik Project pada Create: Project, pilih Windows Form Application, ketik nama project dengan nama Kalkulator cinta, klik OK untuk memulai.
4. Setelah klik open,akan tampak tampilan form1 untuk memulai aplikasi.
5. Buatlah 2 Label, 2 Tabel, 3 Command Button (Button), dan 2 Picture Box, seperti gambar dibawah ini :
6. Aturlah masing - masing tollbar seperti dibawah ini :
Properties :
1. Form :
Caption (Text) : Kalkulator Cinta
Size : 420, 300
BackgroundImage : (Sesuai yang anda inginkan)
BackgroundImageLayout : Stretch
Icon : (Sesuai yang anda inginkan)
2. Text Box1 :
Caption (Text) :
Size : 287, 26
Location : 12, 61
3. Text Box2 :
Caption (text) :
Size : 345, 29
Location : 12, 156
4. Label1 :
Caption (Text) : Nama Cowok
Size : 287, 25
Location : 7, 9
FontColor : (Sesuai yang anda inginkan)
5. Label2 :
Caption (Text) : Nama Cewek
Size : 287, 25
Location : 7, 104
FontColor : (Sesuai yang anda inginkan)
6. Command Button1 (Button) :
Caption (Text) : Hitung
Size : 73, 43
Location : 12, 192
BackColor : (Sesuai yang anda inginkan)
7. Command Button2 (Button) :
Caption (Text) : Hapus
Size : 73, 43
Location : 118, 192
BackColor : (Sesuai yang anda inginkan)
8. Command Button3 (Button) :
Caption (Text) : Keluar
Size : 73, 43
Location : 221, 192
BackColor : (Sesuai yang anda inginkan)
9. Picture Box1 :
Size : 80, 80
Location : 318, 36
BackgroundImage : (Sesuai yang anda inginkan)
10. Picture Box2 :
Size : 80, 80
Location : 318, 134
BackgroundImage : (Sesuai yang anda inginkan)Properties :
1. Form :
Caption (Text) : Kalkulator Cinta
Size : 420, 300
BackgroundImage : (Sesuai yang anda inginkan)
BackgroundImageLayout : Stretch
Icon : (Sesuai yang anda inginkan)
2. Text Box1 :
Caption (Text) :
Size : 287, 26
Location : 12, 61
3. Text Box2 :
Caption (text) :
Size : 345, 29
Location : 12, 156
4. Label1 :
Caption (Text) : Nama Cowok
Size : 287, 25
Location : 7, 9
FontColor : (Sesuai yang anda inginkan)
5. Label2 :
Caption (Text) : Nama Cewek
Size : 287, 25
Location : 7, 104
FontColor : (Sesuai yang anda inginkan)
6. Command Button1 (Button) :
Caption (Text) : Hitung
Size : 73, 43
Location : 12, 192
BackColor : (Sesuai yang anda inginkan)
7. Command Button2 (Button) :
Caption (Text) : Hapus
Size : 73, 43
Location : 118, 192
BackColor : (Sesuai yang anda inginkan)
8. Command Button3 (Button) :
Caption (Text) : Keluar
Size : 73, 43
Location : 221, 192
BackColor : (Sesuai yang anda inginkan)
9. Picture Box1 :
Size : 80, 80
Location : 318, 36
BackgroundImage : (Sesuai yang anda inginkan)
10. Picture Box2 :
Size : 80, 80
Location : 318, 134
BackgroundImage : (Sesuai yang anda inginkan)Properties :
1. Form :
Caption (Text) : Kalkulator Cinta
Size : 420, 300
BackgroundImage : (Sesuai yang anda inginkan)
BackgroundImageLayout : Stretch
Icon : (Sesuai yang anda inginkan)
2. Text Box1 :
Caption (Text) :
Size : 287, 26
Location : 12, 61
3. Text Box2 :
Caption (text) :
Size : 345, 29
Location : 12, 156
4. Label1 :
Caption (Text) : Nama Cowok
Size : 287, 25
Location : 7, 9
FontColor : (Sesuai yang anda inginkan)
5. Label2 :
Caption (Text) : Nama Cewek
Size : 287, 25
Location : 7, 104
FontColor : (Sesuai yang anda inginkan)
6. Command Button1 (Button) :
Caption (Text) : Hitung
Size : 73, 43
Location : 12, 192
BackColor : (Sesuai yang anda inginkan)
7. Command Button2 (Button) :
Caption (Text) : Hapus
Size : 73, 43
Location : 118, 192
BackColor : (Sesuai yang anda inginkan)
8. Command Button3 (Button) :
Caption (Text) : Keluar
Size : 73, 43
Location : 221, 192
BackColor : (Sesuai yang anda inginkan)
9. Picture Box1 :
Size : 80, 80
Location : 318, 36
BackgroundImage : (Sesuai yang anda inginkan)
10. Picture Box2 :
Size : 80, 80
Location : 318, 134
BackgroundImage : (Sesuai yang anda inginkan)Properties :
1. Form :
Caption (Text) : Kalkulator Cinta
Size : 420, 300
BackgroundImage : (Sesuai yang anda inginkan)
BackgroundImageLayout : Stretch
Icon : (Sesuai yang anda inginkan)
2. Text Box1 :
Caption (Text) :
Size : 287, 26
Location : 12, 61
3. Text Box2 :
Caption (text) :
Size : 345, 29
Location : 12, 156
4. Label1 :
Caption (Text) : Nama Cowok
Size : 287, 25
Location : 7, 9
FontColor : (Sesuai yang anda inginkan)
5. Label2 :
Caption (Text) : Nama Cewek
Size : 287, 25
Location : 7, 104
FontColor : (Sesuai yang anda inginkan)
6. Command Button1 (Button) :
Caption (Text) : Hitung
Size : 73, 43
Location : 12, 192
BackColor : (Sesuai yang anda inginkan)
7. Command Button2 (Button) :
Caption (Text) : Hapus
Size : 73, 43
Location : 118, 192
BackColor : (Sesuai yang anda inginkan)
8. Command Button3 (Button) :
Caption (Text) : Keluar
Size : 73, 43
Location : 221, 192
BackColor : (Sesuai yang anda inginkan)
9. Picture Box1 :
Size : 80, 80
Location : 318, 36
BackgroundImage : (Sesuai yang anda inginkan)
10. Picture Box2 :
Size : 80, 80
Location : 318, 134
BackgroundImage : (Sesuai yang anda inginkan)Properties :
1. Form :
Caption (Text) : Kalkulator Cinta
Size : 420, 300
BackgroundImage : (Sesuai yang anda inginkan)
BackgroundImageLayout : Stretch
Icon : (Sesuai yang anda inginkan)
2. Text Box1 :
Caption (Text) :
Size : 287, 26
Location : 12, 61
3. Text Box2 :
Caption (text) :
Size : 345, 29
Location : 12, 156
4. Label1 :
Caption (Text) : Nama Cowok
Size : 287, 25
Location : 7, 9
FontColor : (Sesuai yang anda inginkan)
5. Label2 :
Caption (Text) : Nama Cewek
Size : 287, 25
Location : 7, 104
FontColor : (Sesuai yang anda inginkan)
6. Command Button1 (Button) :
Caption (Text) : Hitung
Size : 73, 43
Location : 12, 192
BackColor : (Sesuai yang anda inginkan)
7. Command Button2 (Button) :
Caption (Text) : Hapus
Size : 73, 43
Location : 118, 192
BackColor : (Sesuai yang anda inginkan)
8. Command Button3 (Button) :
Caption (Text) : Keluar
Size : 73, 43
Location : 221, 192
BackColor : (Sesuai yang anda inginkan)
9. Picture Box1 :
Size : 80, 80
Location : 318, 36
BackgroundImage : (Sesuai yang anda inginkan)
10. Picture Box2 :
Size : 80, 80
Location : 318, 134
BackgroundImage : (Sesuai yang anda inginkan)
7. Setelah diatur maka akan menjadi seperti gambar dibawah ini :
8. Berikutnya masukkan script code dibawah ini dengan cara berikut ini :
1. Klik kanan pada Label1, lalu klik View Code.
2. Maka akan muncul form1.vb* seperti gambar berikut ini :
3. Setelah itu hapus semua script code yang ada di form1.vb*.
4. Selanjutnya copy script code dibawah ini lalu paste ke dalam Form1.vb*, seperti gambar berikut ini.
Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Friend Class Form1
Inherits System.Windows.Forms.Form
'www.rudymaturbongs.blogspot.com
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
Dim sBuffer As String
Dim sBuffer2 As String
Dim nCowokLen As Short
Dim nCewekLen As Short
Dim nCtr As Short
Dim nCtr2 As Short
Dim nTotalLen As Short
Dim nJumlah As Short
Dim c As String
Dim c1 As String
Dim BoolExit As Boolean
Dim nKomentar As String
If Len(Text1.Text) <= 0 Then MsgBox("Silahkan masukkan nama cowoknya", MsgBoxStyle.Information) : Text1.Focus() : Exit Sub
If Len(Text2.Text) <= 0 Then MsgBox("Silahkan masukkan nama ceweknya", MsgBoxStyle.Information) : Text2.Focus() : Exit Sub
Text1.Text = Trim(Text1.Text)
Text2.Text = Trim(Text2.Text)
nCowokLen = Len(Text1.Text)
nCewekLen = Len(Text2.Text)
sBuffer = UCase(Text1.Text) & "LOVES" & UCase(Text2.Text)
nTotalLen = Len(sBuffer)
For nCtr = 1 To nTotalLen
nJumlah = 1
If nCtr = nTotalLen And Mid(sBuffer, nCtr, 1) = Chr(255) Then BoolExit = True
For nCtr2 = nCtr + 1 To nTotalLen
If Mid(sBuffer, nCtr, 1) = Chr(255) Then BoolExit = True : Exit For
If Mid(sBuffer, nCtr, 1) = Mid(sBuffer, nCtr2, 1) Then
Mid(sBuffer, nCtr2, 1) = Chr(255)
nJumlah = nJumlah + 1
End If
Next nCtr2
If nJumlah = 0 Then nJumlah = 1
If BoolExit = True Then
BoolExit = False
Else
sBuffer2 = sBuffer2 & nJumlah
Mid(sBuffer, nCtr, 1) = Chr(255)
End If
System.Windows.Forms.Application.DoEvents()
Next nCtr
Do
sBuffer = sBuffer2
sBuffer2 = ""
nTotalLen = Len(sBuffer)
If nTotalLen <= 2 Then Exit Do
Do
c = CStr(CShort(VB.Left(sBuffer, 1)))
c1 = CStr(CShort(VB.Right(sBuffer, 1)))
sBuffer2 = sBuffer2 & CShort(c) + CShort(c1)
sBuffer = Mid(sBuffer, 2, nTotalLen - 2)
nTotalLen = Len(sBuffer)
Loop While Not Len(sBuffer) <= 1
If Len(sBuffer) = 1 Then sBuffer2 = sBuffer2 & sBuffer
Loop While Not Len(sBuffer2) <= 1
If CShort(sBuffer) < 25 Then
nKomentar = "Coba cewek yang lain."
End If
If Diantara(CShort(sBuffer), 25, 50) Then
nKomentar = "Cukup."
End If
If Diantara(CShort(sBuffer), 50, 75) Then
nKomentar = "Ini baik."
End If
If Diantara(CShort(sBuffer), 75, 100) Then
nKomentar = "Luar biasa!!."
End If
MsgBox(Text1.Text & " mencintai " & Text2.Text & " sebesar " & sBuffer & " %", MsgBoxStyle.Information, nKomentar)
End Sub
Private Function Diantara(ByRef nNomor As Short, ByRef nPertama As Short, ByRef nKedua As Short, Optional ByRef BoundIncluded As Boolean = False) As Boolean
If BoundIncluded = True Then
If nNomor >= nPertama And nNomor <= nKedua Then
Diantara = True
Else
Diantara = False
End If
Else
If nNomor > nPertama And nNomor < nKedua Then
Diantara = True
Else
Diantara = False
End If
End If
End Function
Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
End
End Sub
Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
Text1.Text = ""
Text2.Text = ""
End Sub
End Class
5. Setelah di paste maka akan menjadi seperti gambar dibawah ini :
6. Sekarang sudah selasai. Untuk mencobanya klik Start Debugging pada toolbar, seperti gambar berikut ini :
7. Maka akan muncul aplication kalkulator Cinta yang telah anda buat, seperti gambar berikut ini :
8. Untuk Mencobanya, ketik Nama Cowok (Misalnya : Anto)pada text box1, lalu ketik Nama Cewek (Misalnya : Rima) pada text box2, kemudian klik hitung untuk mengetahui berapa cinta kalian.
9. Untuk menyimpan Kalkulator anda klik Save All pada toolbar.
10. A. Simpan file dengan properties :
Name: Kalkulator Cinta
Location : D:\
Solution Name: Kalkulator Cinta
B. Lalu klik Save.
11. Sekarang buka file yang sudah disimpan (D:\Kalkulator Cinta\Kalkulator Cinta\bin\Debug).
12. Maka akan muncul Kalkulator yang sudah anda buat.
13. Cobalah ketik Nama Cowok (Misalnya : Anto)pada text box1, lalu ketik Nama Cewek (Misalnya : Rima) pada text box2, kemudian klik hitung untuk mengetahui berapa cinta kalian.
14. Sekarang Kalkulator Cinta yang anda buat sudah selesai.
Terima Kasih.
Anda dapat Mendownload Kalkulator Cinta dengan mengklik link dibawah ini :
http://www.mediafire.com/?842vghv8yev8sx1
Password : kalkulator cinta
Anda juga dapat Mendownload Kalkulator dengan mengklik link dibawah ini :
http://www.mediafire.com/?zj41vvw02n2s8w3
Password : kalkulator
Cara Membuat Kalkulator menggunakan Visual Basic 2008
Visual Basic adalah suatu bahasa pemrogramman yang mudah dan efisien. Visual basic sangat mudah dipelajari. Salah satu contoh aplikasi visual basic paling sederhana: Aplikasi perhitungan melalui Visual Basic. Sebagai contoh Kalkulator.
Program kalkulator adalah program standar yang sudah tersedia di Microsoft Windows. Tetapi, tak ada salahnya jika kita mencoba membuat kalkulator sendiri dengan Microsoft Visual Basic 2008
1. Pastikan PC anda telah terinstal Microsoft Visual Basic 2008
2. Lalu buka Start-Progam-Microsoft Visual Basic 2008 Express Edition
3. Akan ada Tampilan utama, klik Project pada Create: Project, pilih Windows Form Application, ketik nama project dengan nama Kalkulator, klik OK untuk memulai.
4. Setelah klik open,akan tampak tampilan form1 untuk memulai aplikasi.
5.Buatlah 2 Tabel, 2 Label, 5 Command Button (Button), dan Date Time Picker seperti gambar di bawah ini:
6. Aturlah masing - masing tollbar seperti dibawah ini :
Properties :
1. Form :
Caption : Kalkulator
Size : 450, 450
2. Text Box1 :
Caption :
Size : 345, 29
Location : 50, 12
3. Text Box2 :
Caption :
Size : 345, 29
Location : 50, 85
4. Label1 :
Caption :
Size : 0, 24
Location : 203, 58
5. Label2 :
Caption :
Size : 0, 24
Location : 203, 136
6. Command Button1 :
Caption : -
Size : 75, 36
Location : 91, 161
7. Command Button2 :
Caption : +
Size : 75, 36
Location : 253, 161
8. Command Button3 :
Caption : *
Size : 75, 36
Location : 91, 247
9. Command Button4 :
Caption : /
Size : 75, 36
Location : 253, 247
10. Command Button5 :
Caption : Clear
Size : 75, 36
Location : 172, 195
11. Date Time Picker :
Size : 237, 20
Location : 91, 322
7. Setelah diatur maka akan menjadi seperti gambar dibawah ini :
8. Berikutnya masukkan script code dibawah ini dengan cara berikut ini :
1. Klik kanan pada Text Box1, lalu klik View Code.
2. Maka akan muncul form1.vb* seperti gambar berikut ini :
3. Setelah itu hapus semua script code yang ada di form1.vb*.
4. Selanjutnya copy script code dibawah ini lalu paste ke dalam Form1.vb*, seperti gambar berikut ini.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Label1.Text = "+"
Label2.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "-"
Label2.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Label1.Text = "*"
Label2.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Label1.Text = "/"
Label2.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End Sub
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged
Update()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TextBox1.Text = ""
TextBox2.Text = ""
Label1.Text = ""
Label2.Text = ""
End Sub
End Class
5. Setelah di paste maka akan menjadi seperti gambar dibawah ini :
6. Jika anda ingin menambahkan background pada kalkulator anda, klik Form1.vb [Design], lalu pada Properties cari backgroundImage, lalu klik.
7. Maka akan muncul Select Resource, seperti gambar dibawah ini :
8. Lalu pilih Local resource, lalu klik Import... seperti gambar berikut :
9. Selanjutnya pilih gambar yang anda inginkan lalu klik open. Setelah itu klik Ok.
10. Maka akan hasilnya akan seperti ini :
11. Sekarang sudah selasai. Untuk mencobanya klik Start Debugging pada toolbar, seperti gambar berikut ini :
12. Maka akan muncul aplication kalkulator yang telah anda buat, seperti gambar berikut ini :
13. Untuk menyimpan Kalkulator anda klik Save All pada toolbar.
14. Simpan file dengan properties :
Name: Kalkulator
Location : D:\
Solution Name: Kalkulator
Lalu klik Save.
15. Sekarang buka file yang sudah disimpan ( D:\Kalkulator\Kalkulator\bin\Debug ) lalu pilih dan klik Kalkulator.
16. Maka akan muncul Kalkulator yang sudah anda buat.
Anda dapat mendownload kalkulator dengan mengklik link dibawah ini :
http://www.mediafire.com/?zj41vvw02n2s8w3
Password : kalkulator
Anda juga dapat mendownload kalkulator cinta dengan mengklik link dibawah ini :
http://www.mediafire.com/?plguq6yyxkx7ex0
Password : kalkulator cinta
Catatan :
Jika anda belum mempunyai Winrar, anda dapat mendownloadnya, dengan mengklik link dibawah ini :
dengan mengklik link dibawah ini :
http://www.downloadwinrar.org/
Terima Kasih.