• Like
Tutorial pembuatan calculator22
Upcoming SlideShare
Loading in...5
×

Tutorial pembuatan calculator22

  • 46 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
46
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Tutorial pembuatan calculatormenggunakan Microsoft visual basic2010 express editionNama :M. Ario Bagus P.Kelas :X RPL 1Sekolah :SMKN 1 DEPOK
  • 2. 1. Download aplikasi visual basic 2010 express edition nyadi:http://www.microsoft.com/visualstudio/en-gb/express
  • 3. 2. Setelah aplikasi nya di download, install aplikasi nya, maka dia akanotomatis mendownload visual basic 2010 express editionyangkita inginkan.
  • 4. 3. Setelah proses download selesai, lalu bukalah aplikasi nya
  • 5. 4. Setelah aplikasi di buka, lalu klik file new project windowsform application. Dan pada kolom nama beri nama CALCULATOR
  • 6. 5. Pada toolbox all windows form, tambahkan 19 button dan 1 textbox kedalam FORM anda, dan susun lah seperti pada nomor 6
  • 7. 6. Inilah hasil setelah di susun7. Lalu editlah pada properties Form1 sesuai table di bawah iniFormBorderStyle Fixed 3DIcon (*bebas tapi harus .ico)MaximizeBox FalseStart Position Center ScreenText Calculator
  • 8. - Klik 2 kali form nya, lalu di bawah public class form1 masukankode di bawah iniDim Operand1 AsDoubleDim Operand2 AsDoubleDim [Operator] AsString8. Lalu editlah pada properties Button1 sesuai tabel di bawah iniLocked TrueText 1- Double click Button 1 dan masukan kode di bawah iniPrivateSub Button1_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button1.Click, Button2.Click,Button3.Click, Button4.Click, Button5.Click, Button6.Click,Button7.Click, Button8.Click, Button9.Click, Button11.ClickTextBox1.Text = TextBox1.Text & sender.textEndSub9. Lalu editlah properties button button berikut- Properties pada button 2Locked TrueText 2- Properties pada button 3Locked TrueText 3- Properties pada button 4Locked TrueText 4
  • 9. - Properties pada button 5Locked TrueText 5- Properties pada button 6Locked TrueText 6- Properties pada button 7Locked TrueText 7- Properties pada button 8Locked TrueText 8- Properties pada button 9Locked TrueText 9- Properties pada button 10Locked TrueText .10. Double click Button . , dan masukan code di bawah ini
  • 10. PrivateSub Button10_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button10.ClickIf InStr(TextBox1.Text, ".") > 0 ThenExit SubElseTextBox1.Text = TextBox1.Text &"."EndIfEndSub- Properties pada button 11Locked TrueText 0- Properties pada button 12ForeColor (bebas, sesuka anda)Locked TrueText C11.Double click button C dan masukan code di bawah iniPrivateSub Button12_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button12.ClickTextBox1.Text = ""EndSub12. Properties pada button 13ForeColor (bebas, sesuka anda)Locked TrueText +Double click button + , dan masukan kode di bawah ini
  • 11. PrivateSub Button13_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button13.ClickOperand1 = Val(TextBox1.Text)TextBox1.Text = ""TextBox1.Focus()[Operator] = "+"EndSub13. Properties pada button 14ForeColor (bebas, sesuka anda)Locked TrueText -Double click button - , dan masukan code di bawah iniPrivateSub Button14_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button14.ClickOperand1 = Val(TextBox1.Text)TextBox1.Text = ""TextBox1.Focus()[Operator] = "-"EndSub14. Properties pada button 15ForeColor (bebas, sesuka anda)Locked TrueText *Double click button * , dan masukan kode di bawah iniPrivateSub Button14_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button14.ClickOperand1 = Val(TextBox1.Text)TextBox1.Text = ""TextBox1.Focus()[Operator] = "*"
  • 12. EndSub15. Pada properties button 16ForeColor (bebas, sesuka anda)Locked TrueText /- Double click button / , dan masukan code dibawah iniPrivateSub Button16_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button16.ClickOperand1 = Val(TextBox1.Text)TextBox1.Text = ""TextBox1.Focus()[Operator] = "/"EndSub16. Pada properties button 17Locked TrueText 1/x- Double click button 1/x , dan masukan code di bawah iniPrivateSub Button17_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button17.ClickDim convert AsSingleIf TextBox1.Text <> 0 Thenconvert = 1 / Val(TextBox1.Text)TextBox1.Text = convertEndIfEndSub
  • 13. 17. Pada properties button 18Locked TrueText +-- Double click button +- , dan masukan code di bawah iniPrivateSub Button18_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button18.ClickTextBox1.Text = -1 * TextBox1.TextEndSub18. Properties pada button 19Locked TrueText =- Double click button = , dan masukan code di bawah ini:PrivateSub Button19_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button19.ClickDim Result AsDoubleOperand2 = Val(TextBox1.Text)If [Operator] = "+" Then Result = Operand1 + Operand2ElseIf [Operator] = "-" Then Result = Operand1 - Operand2ElseIf [Operator] = "/" Then Result = Operand1 / Operand2ElseIf [Operator] = "*" Then Result = Operand1 * Operand2End IfSelectCase [Operator]Case"+"Result = Operand1 + Operand2MsgBox(Result.ToString("#,###.00"),MsgBoxStyle.Information, "Result")TextBox1.Text = Result.ToString("#,###.00")Case"-"Result = Operand1 - Operand2MsgBox(Result.ToString("#,###.00"),MsgBoxStyle.Information, "Result")TextBox1.Text = Result.ToString("#,###.00")Case"/"Result = Operand1 / Operand2MsgBox(Result.ToString("#,###.00"),MsgBoxStyle.Information, "Result")TextBox1.Text = Result.ToString("#,###.00")Case"*"Result = Operand1 * Operand2MsgBox(Result.ToString("#,###.00"),
  • 14. MsgBoxStyle.Information, "Result")TextBox1.Text = Result.ToString("#,###.00")EndSelectTextBox1.Text = Result.ToString("#,###.00")EndSubEndClass19. Sebelum melakukan komplikasi program, double click myproject pada colom solution explorer, pilih Assembly Informationdan kalian bias mengisi penjelasan atas software yang kaliat buatini, dan pilih icon sesuka kalian (*.ico)
  • 15. 20. Dan ini lah hasil ketika gambar sudah di RUN, dan tidakterjadi DEBUG atau eror