Hai guys, selamat datang di blog saya, ketemu
lagi nih, kali ini kita akan membuat sebuah program lagi yang pastinnya
menggunakan Visual Studio 2010. Sebelum kita membuat programnnya liat dulu yuk
apa itu visual studio dan kegunaan lainnya mari kita lihat,
Microsoft Visual Studio merupakan sebuah perangkat lunak lengkap (suite) yang dapat digunakan
untuk melakukan pengembangan aplikasi, baik itu aplikasi bisnis, aplikasi
personal, ataupun komponen aplikasinya, dalam bentuk aplikasi console, aplikasi
Windows, ataupun aplikasi Web. Visual Studio mencakup kompiler,
SDK, Integrated
Development Environment (IDE), dan
dokumentasi (umumnya berupa MSDN Library). Kompiler yang dimasukkan ke dalam paket
Visual Studio antara lain Visual C++,
Visual C#, Visual Basic, Visual Basic .NET, Visual
InterDev, Visual J++, Visual J#, Visual FoxPro, dan Visual
SourceSafe.
Microsoft Visual Studio dapat digunakan untuk
mengembangkan aplikasi dalam native code (dalam bentuk bahasa mesin yang
berjalan di atas Windows) ataupun managed code (dalam bentuk Microsoft
Intermediate Language di atas
.NET Framework). Selain itu, Visual Studio juga dapat digunakan untuk
mengembangkan aplikasi Silverlight, aplikasi Windows Mobile (yang berjalan di
atas .NET Compact Framework).




Dan hasilnya
seperti dibawah ini









Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
Me.Text
= "LOGIN"
GroupBox1.Text = ""
Me.BackColor
= Color.DodgerBlue
GroupBox1.BackColor = Color.Blue
Label1.ForeColor = Color.Transparent
Label2.ForeColor = Color.Transparent
Label3.ForeColor = Color.Transparent
Label1.Text = "Silahkan Login"
Label2.Text = "Username"
Label3.Text = "Password"
Button1.Text = "Masuk"
Button2.Text = "Cancel"
Label1.BorderStyle = BorderStyle.Fixed3D
Label1.Font = New Font(Label1.Font, FontStyle.Bold)
Label2.Font = New Font(Label2.Font, FontStyle.Bold)
Label3.Font = New Font(Label3.Font, FontStyle.Bold)
Button1.Cursor = Cursors.Hand
Button2.Cursor = Cursors.Hand
TextBox1.BorderStyle = BorderStyle.FixedSingle
TextBox2.BorderStyle = BorderStyle.FixedSingle
TextBox1.BackColor = Color.AntiqueWhite
TextBox2.BackColor = Color.AntiqueWhite
TextBox1.CharacterCasing = CharacterCasing.Upper
TextBox2.CharacterCasing = CharacterCasing.Lower
TextBox2.PasswordChar = "*"
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
If
(TextBox1.Text = "IMAM AFANDI") And (TextBox2.Text = "manithom")
Then
Form2.Show()
Me.Hide()
Else
MessageBox.Show("Warning User dan Password anda Salah",
"Informasi", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
Private Sub TextBox1_KeyPress(ByVal
sender As System.Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If
e.KeyChar = Chr(13) Then TextBox2.Focus()
End Sub
Private Sub TextBox2_KeyPress(ByVal
sender As System.Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If
e.KeyChar = Chr(13) Then Button1.Focus()
End Sub
Private Sub Button1_KeyPress(ByVal
sender As System.Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Button1.KeyPress
If
e.KeyChar = Chr(13) Then Button2.Focus()
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
Close()
End Sub
End Class
|

Agar program
dapat berjalan kita harus memasukan kodingnnya terlebih dahulu, maka masukan
kodingnya seperti ini :
Public Class Form2
Private Sub Form2_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
Me.Text
= "Program Menghitung Volume Balok"
Label1.Text = "MASUKAN NILAI"
Label2.Text = "PANJANG"
Label3.Text = "LEBAR"
Label4.Text = "TINGGI"
Label5.Text = "LUAS VOLUME BALOK"
Label6.Text = ""
Label1.Font = New Font(Label1.Font, FontStyle.Bold)
Label2.Font = New Font(Label2.Font, FontStyle.Bold)
Label3.Font = New Font(Label3.Font, FontStyle.Bold)
Label4.Font = New Font(Label4.Font, FontStyle.Bold)
Label5.Font = New Font(Label5.Font, FontStyle.Bold)
Label6.Font = New Font(Label6.Font, FontStyle.Underline)
CheckBox1.Text = "Tampilkan Rumus Volume Balok"
GroupBox1.Text = ""
GroupBox2.Text = ""
Button1.Text = "Hasil"
Button2.Text = "Hapus"
Button3.Text = "Keluar"
Button1.Cursor = Cursors.Hand
Button2.Cursor = Cursors.Hand
Label1.BorderStyle = BorderStyle.FixedSingle
TextBox1.BorderStyle = BorderStyle.FixedSingle
TextBox2.BorderStyle = BorderStyle.FixedSingle
TextBox3.BorderStyle = BorderStyle.FixedSingle
TextBox4.BorderStyle = BorderStyle.FixedSingle
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
TextBox4.Text = Val(TextBox1.Text) *
Val(TextBox2.Text) * Val(TextBox3.Text)
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles CheckBox1.CheckedChanged
If
CheckBox1.Checked = True Then
Label6.Text = "Panjang * Lebar * Tinggi"
Else
Label6.Text = ""
End If
End Sub
Private Sub TextBox1_KeyPress(ByVal
sender As System.Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If
e.KeyChar = Chr(13) Then TextBox2.Focus()
End Sub
Private Sub TextBox2_KeyPress(ByVal
sender As System.Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If
e.KeyChar = Chr(13) Then TextBox3.Focus()
End Sub
Private Sub TextBox3_KeyPress(ByVal
sender As System.Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
If
e.KeyChar = Chr(13) Then Button1.Focus()
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Close()
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
End Class
|



Pada form1 kita
akan di minta memasukkan username dan password
Maka masukkan
password dan user name yang sudah kita
buat tadi Username saya “IMAM AFANDI” Password “manithom”
Jika
Username dan Password yang anda masukan salah maka, akan muncul pesan dialog
erorr seperti ini
Oleh karena
itu masukan Username dan pasword dengan benar, jika berhasil Login maka kita
akan dibawa masuk ke form2 yaitu program Menghitung Luas Volume Kubus
gambarnnya seperti dibawah ini
Coba Masukan
Nilainya Misalnnya Kita Masukan Panjang=4 Lebar=4 dan tinggi=4
Lalu tekan tombol
hasil berwarna merah pojok bawah sbelah kiri, maka hasillnya akan ditampilkan
seperti ini
Bagaimana
mudah bukan, ternyata membuat program menguakan VB 2010 itu tidak terlalu
susah, hannya saja butuh ketelitian dalam membuat dan memecahkan codingnya saja disamping itu program ini juga dapat
membantu kita dalam pelajaran matematika dan pelajaran lainnya,.
Demikian
semoga dengan adannya artikel ini dapat menambah wawasan kita dalam mengenal
program vb dan bisa mengoperasikannya sehingga dapat bermanfaat dalam kehidupan
sehari-hari tidak lupa juga penulis meminta kritik dan sarannya agar artikel
ini dapat sempurna dan lebih baik lagi
Terima kasih
Was.........war........Wab
0 komentar:
Posting Komentar
Trimakasih Sudah Mengunjungi Blog saya