Rabu, 01 Juni 2016

Cara membuat sevent Segment Di Visual Basic

Cara membuat sevent Segment Di Visual Basic

Dalam membuat 7 segment pasti anda sudah terbayang apa sih itu 7 segment, ya sevent segment merupakan segment yang berjumlah 7 biasanya digunakan untuk membuat jam digital, text dan banyak hasil dari sevent segment namun dalam project kali ini kita mulai dari dasar dulu barulah jika sudah bisa mengerti anda bisa mengembakannya lagi menjadi ide yang sangat baik.
Di dalam project ini terdiri dari :
  • 7 Shape 
  • 9 Commond Button
Saya menambahkan beberapa tambahan
  • 2 Timer untuk kelap kelip
  • 1 Frame untuk belakang sevent sigment 
[info title="Coding Visual Basic 6" icon="info-circle"]Private Sub Command1_Click()
Shape2.FillColor = vbRed
Shape3.FillColor = vbRed
Shape1.FillColor = 1
Shape7.FillColor = 1
Shape6.FillColor = 1
Shape5.FillColor = 1
Shape4.FillColor = 1
End Sub

Private Sub Command10_Click()
Shape2.FillColor = vbRed
Shape3.FillColor = vbRed
Shape1.FillColor = vbRed
Shape7.FillColor = 0
Shape6.FillColor = 0
Shape5.FillColor = 0
Shape4.FillColor = 0
End Sub

Private Sub Command11_Click()
Shape2.FillColor = vbRed
Shape3.FillColor = vbRed
Shape1.FillColor = vbRed
Shape7.FillColor = vbRed
Shape6.FillColor = vbRed
Shape5.FillColor = vbRed
Shape4.FillColor = vbRed
End Sub

Private Sub Command12_Click()
Shape2.FillColor = vbRed
Shape3.FillColor = vbRed
Shape1.FillColor = vbRed
Shape7.FillColor = vbRed
Shape6.FillColor = vbRed
Shape5.FillColor = 0
Shape4.FillColor = vbRed
End Sub

Private Sub Command13_Click()
Form3.Visible = vbNormalFocus
Unload Me
End Sub

Private Sub Command2_Click()
Shape1.FillColor = vbRed
Shape2.FillColor = vbRed
Shape3.FillColor = 0
Shape4.FillColor = vbRed
Shape5.FillColor = vbRed
Shape6.FillColor = 0
Shape7.FillColor = vbRed

End Sub

Private Sub Command3_Click()
Shape2.FillColor = vbRed
Shape3.FillColor = vbRed
Shape1.FillColor = vbRed
Shape7.FillColor = vbRed
Shape6.FillColor = 0
Shape5.FillColor = 0
Shape4.FillColor = vbRed
End Sub

Private Sub Command4_Click()
Shape2.FillColor = vbRed
Shape3.FillColor = vbRed
Shape1.FillColor = 0
Shape7.FillColor = vbRed
Shape6.FillColor = vbRed
Shape5.FillColor = 0
Shape4.FillColor = 0
End Sub

Private Sub Command5_Click()
Shape2.FillColor = 0
Shape5.FillColor = vbRed
Shape3.FillColor = vbRed
Shape1.FillColor = vbRed
Shape7.FillColor = vbRed
Shape6.FillColor = vbRed
Shape4.FillColor = vbRed
End Sub

Private Sub Command6_Click()
Shape2.FillColor = 0
Shape3.FillColor = vbRed
Shape1.FillColor = vbRed
Shape7.FillColor = vbRed
Shape6.FillColor = vbRed
Shape5.FillColor = 0
Shape4.FillColor = vbRed
End Sub

Private Sub Timer1_Timer()
Shape1.Visible = False
Shape2.Visible = False
Shape3.Visible = False
Shape4.Visible = False
Shape5.Visible = False
Shape6.Visible = False
Shape7.Visible = False
End Sub

Private Sub Timer2_Timer()
Shape1.Visible = True
Shape7.Visible = True
Shape2.Visible = True
Shape3.Visible = True
Shape4.Visible = True
Shape5.Visible = True
Shape6.Visible = True
End Sub[/info]

0 komentar:

Posting Komentar