• RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter

contoh program menu VB

Disini saya posting contoh program menggunakan tool option
pertama buat rncangan form seperti ini


source coding:

Private Sub Command1_Click()
Option6 = False
Option7 = False
Option8 = False
Option9 = False
Option10 = False
Label2.Caption = Clear
End Sub



Private Sub Command2_Click()
Option1 = False
Option2 = False
Option3 = False
Option4 = False
Option5 = False
Label1.Caption = Clear

End Sub



Private Sub Command3_Click()
Text13.Text = Val(Text1) * Val(Text15)
Text14.Text = Val(Text2) * Val(Text16)
Text17.Text = Val(Text13) + Val(Text14)
If Text1.Text = "" Then
MsgBox ("masukkan jumlah makanan yg di jual")
Text1.SetFocus
ElseIf Text2.Text = "" Then
MsgBox ("masukkan jumlah minuman yg di jual")
Text2.SetFocus

End If
End Sub

Private Sub Command4_Click()
End

End Sub

Private Sub Form_Load()
Label1.Caption = Clear
Label2.Caption = Clear
Text1.Text = Clear
Text2.Text = Clear
Text13.Text = Clear
Text14.Text = Clear
Text15.Text = Clear
Text16.Text = Clear
Text17.Text = Clear
Option1 = False
Option2 = False
Option3 = False
Option4 = False
Option5 = False
Option6 = False
Option7 = False
Option8 = False
Option9 = False
Option10 = False
Frame1.BackColor = vbBlue
Frame2.BackColor = vbRed


End Sub

Private Sub Option1_Click()
Label1.Caption = Option1.Caption
Label1.FontSize = 20
Label1.ForeColor = vbRed
Text1.SetFocus
Text15.Text = Text3.Text
End Sub

Private Sub Option2_Click()
Label1.Caption = Option2.Caption
Label1.FontSize = 20
Label1.ForeColor = vbRed
Text1.SetFocus
Text15.Text = Text4.Text
End Sub
Private Sub Option3_Click()
Label1.Caption = Option3.Caption
Label1.FontSize = 20
Label1.ForeColor = vbRed
Text1.SetFocus
Text15.Text = Text5.Text
End Sub
Private Sub Option4_Click()
Label1.Caption = Option4.Caption
Label1.FontSize = 20
Label1.ForeColor = vbRed
Text1.SetFocus
Text15.Text = Text6.Text
End Sub
Private Sub Option5_Click()
Label1.Caption = Option5.Caption
Label1.FontSize = 20
Label1.ForeColor = vbRed
Text1.SetFocus
Text15.Text = Text7.Text
End Sub
Private Sub Option6_Click()
Label2.Caption = Option6.Caption
Label2.FontSize = 20
Label2.ForeColor = vbRed
Text2.SetFocus
Text16.Text = Text8.Text
End Sub
Private Sub Option7_Click()
Label2.Caption = Option7.Caption
Label2.FontSize = 20
Label2.ForeColor = vbRed
Text2.SetFocus
Text16.Text = Text9.Text
End Sub

Private Sub Option8_Click()
Label2.Caption = Option8.Caption
Label2.FontSize = 20
Label2.ForeColor = vbRed
Text2.SetFocus
Text16.Text = Text10.Text
End Sub
Private Sub Option9_Click()
Label2.Caption = Option9.Caption
Label2.FontSize = 20
Label2.ForeColor = vbRed
Text2.SetFocus
Text16.Text = Text11.Text
End Sub
Private Sub Option10_Click()
Label2.Caption = Option10.Caption
Label2.FontSize = 20
Label2.ForeColor = vbRed
Text2.SetFocus
Text16.Text = Text12.Text
End Sub


run:



Semoga  bermanfaat...

 

Recent Posts

BTricks

BThemes

Copyright 2010 Andre Blog - All Rights Reserved.
Designed by Web2feel.com | Bloggerized by Lasantha - Premiumbloggertemplates.com | Affordable HTML Templates from Herotemplates.com.