Ide dalam membuat program ini muncul ketika saya membaca sebuah buku elektronika berjudul belajar elektronika. Di dalam buku tersebut terdapat sebuah gambar aplikasi perhitungan nilai resistansi dari sebuah resistor. Dari situ saya berpikir untuk membuat sendiri aplikasi perhitungan nilai resistor .
Penjelasannya sudah ya,,,
Disini saya tidak akan menjelaskan cara cara memasukkan komponen ke dalam form
seperti label, combobox , dll. Disini saya menganggap teman-teman semua sudah memahami nya.
Langsung aja tutorialnya
1. Buka vb6 -->standard exe
2. Lalu masukkan komponen seperti dibawah ini
daftar daftar komponen:
3.Sebelum memasukkan code dibawah ini, pastikan bahwa semua komponen yang sudah dimasukkan sudah benar.
Dim resistansi, toleransi, toleransi1 As Double
Dim a, b, c, d, e, f, g As Double
Private Sub ccmdHitung_Click()
a = Val(txtGelangI.Text)
b = Val(txtGelangII.Text)
c = Val(txtGelangIII.Text)
d = Val(txtGelangIV.Text)
e = (a & b) * c
f = e - (e * d)
g = e + (e * d)
txtResistansi.Text = e
txtToleransi.Text = f
txtToleransi1.Text = g
End Sub
Private Sub cmdClear_Click()
txtGelangI.Text = ""
txtGelangII.Text = ""
txtGelangIII.Text = ""
txtGelangIV.Text = ""
txtResistansi.Text = ""
txtToleransi.Text = ""
txtToleransi1.Text = ""
Shape2.BorderColor = &HC0C000
Shape2.FillColor = &HC0C000
Shape3.BorderColor = &HC0C000
Shape3.FillColor = &HC0C000
Shape4.BorderColor = &HC0C000
Shape4.FillColor = &HC0C000
Shape5.BorderColor = &HC0C000
Shape5.FillColor = &HC0C000
End Sub
Private Sub cmdKeluar_Click()
If MsgBox("Anda yakin akan keluar?", vbCritical + vbYesNo) = vbYes Then
Unload Me
End If
End Sub
Private Sub Label2_Click(Index As Integer)
Select Case Label2(Index)
Case 0
txtGelangI.Text = "0"
Shape2.BorderColor = vbBlack
Shape2.FillColor = vbBlack
Case 1
txtGelangI.Text = "1"
Shape2.BorderColor = &H80&
Shape2.FillColor = &H80&
Case 2
txtGelangI.Text = "2"
Shape2.BorderColor = vbRed
Shape2.FillColor = vbRed
Case 3
txtGelangI.Text = "3"
Shape2.BorderColor = &H80FF&
Shape2.FillColor = &H80FF&
Case 4
txtGelangI.Text = "4"
Shape2.BorderColor = vbYellow
Shape2.FillColor = vbYellow
Case 5
txtGelangI.Text = "5"
Shape2.BorderColor = vbGreen
Shape2.FillColor = vbGreen
Case 6
txtGelangI.Text = "6"
Shape2.BorderColor = vbBlue
Shape2.FillColor = vbBlue
Case 7
txtGelangI.Text = "7"
Shape2.BackColor = &HC000C0
Shape2.BorderColor = &HC000C0
Shape2.FillColor = &HC000C0
Case 8
txtGelangI.Text = "8"
Shape2.BorderColor = 4210752
Shape2.FillColor = 4210752
Case 9
txtGelangI.Text = "9"
Shape2.BorderColor = vbWhite
Shape2.FillColor = vbWhite
End Select
End Sub
Private Sub Label3_Click(Index As Integer)
Select Case Label3(Index)
Case 0
txtGelangII.Text = "0"
Shape3.BorderColor = vbBlack
Shape3.FillColor = vbBlack
Case 1
txtGelangII.Text = "1"
Shape3.BorderColor = &H80&
Shape3.FillColor = &H80&
Case 2
txtGelangII.Text = "2"
Shape3.BorderColor = vbRed
Shape3.FillColor = vbRed
Case 3
txtGelangII.Text = "3"
Shape3.BorderColor = &H80FF&
Shape3.FillColor = &H80FF&
Case 4
txtGelangII.Text = "4"
Shape3.BorderColor = vbYellow
Shape3.FillColor = vbYellow
Case 5
txtGelangII.Text = "5"
Shape3.BorderColor = vbGreen
Shape3.FillColor = vbGreen
Case 6
txtGelangII.Text = "6"
Shape3.BorderColor = vbBlue
Shape3.FillColor = vbBlue
Case 7
txtGelangII.Text = "7"
Shape3.BorderColor = &HC000C0
Shape3.FillColor = &HC000C0
Case 8
txtGelangII.Text = "8"
Shape3.BorderColor = 4210752
Shape3.FillColor = 4210752
Case 9
txtGelangII.Text = "9"
Shape3.BorderColor = vbWhite
Shape3.FillColor = vbWhite
End Select
End Sub
Private Sub Label4_Click(Index As Integer)
Select Case Label4(Index)
Case 0
txtGelangIII.Text = 10 ^ 0
Shape4.BorderColor = vbBlack
Shape4.FillColor = vbBlack
Case 1
txtGelangIII.Text = 10 ^ 1
Shape4.BorderColor = &H80&
Shape4.FillColor = &H80&
Case 2
txtGelangIII.Text = 10 ^ 2
Shape4.BorderColor = vbRed
Shape4.FillColor = vbRed
Case 3
txtGelangIII.Text = 10 ^ 3
Shape4.BorderColor = &H80FF&
Shape4.FillColor = &H80FF&
Case 4
txtGelangIII.Text = 10 ^ 4
Shape4.BorderColor = vbYellow
Shape4.FillColor = vbYellow
Case 5
txtGelangIII.Text = 10 ^ 5
Shape4.BorderColor = vbGreen
Shape4.FillColor = vbGreen
Case 6
txtGelangIII.Text = 10 ^ 6
Shape4.BorderColor = vbBlue
Shape4.FillColor = vbBlue
Case 7
txtGelangIII.Text = 10 ^ 7
Shape4.BorderColor = &HC000C0
Shape4.FillColor = &HC000C0
Case 8
txtGelangIII.Text = 10 ^ 8
Shape4.BorderColor = 4210752
Shape4.FillColor = 4210752
Case 9
txtGelangIII.Text = 10 ^ 9
Shape4.BorderColor = vbWhite
Shape4.FillColor = vbWhite
End Select
End Sub
Private Sub Label5_Click(Index As Integer)
Select Case Label5(Index)
Case 0
txtGelangIV.Text = "0.05"
Shape5.BorderColor = &H40C0&
Shape5.FillColor = &H40C0&
Case 1
txtGelangIV.Text = "0.1"
Shape5.BorderColor = &HC0C0C0
Shape5.FillColor = &HC0C0C0
End Select
End Sub
Private Sub Label6_Click()
Shape5.BorderColor = &HC0C000
Shape5.FillColor = &HC0C000
txtGelangIV.Text = "0.2"
End Sub
4.hasil setelah program dijalankan.
Selamat mencoba,,,
:D
1xbet - No 1xbet Casino | Live dealer casino online
ReplyDelete1xbet is a reliable casino site that offers a great casino games from https://febcasino.com/review/merit-casino/ the best 1xbet login software providers for the regulated gambling markets. https://deccasino.com/review/merit-casino/ Rating: 8/10 · Review bsjeon by a Tripadvisor user · gri-go.com Free · Sports