“Control Panel Applets” dengan Visual Basic.NET 2010
Contoh sederhana memanggil beberapa Properti Windows yang terdapat pada Control Panel dan event mouse over.
1. Jalankan terlebih dahulu aplikasi Visual Basic 2010
2. Pada tabulasi “Start Page” pilih “New Project” atau tekan tombol “Ctrl + N” pada keyboard
3. Pada jendela “New Project” pilih “Windows Forms Application” kemudian tekan tombol “OK”
Control Properties
Object | Name | Properties | Setting |
Form | Form1 | Font Form Border Style Maximize Box Start Position Text | Tahoma; 8,25pt Fixed Single False Center Screen Control Panel Applets |
Button | Button1 | Text | System Properties |
Button | Button2 | Text | Regional Settings Properties |
Button | Button3 | Text | Date/Time Properties |
Button | Button4 | Text | Mouse Properties |
Button | Button5 | Text | Display Properties |
Button | Button6 | Text | Multimedia Properties |
Button | Button7 | Text | Add/Remove Programs |
Picture Box | PictureBox1 | Border Style Size Mode | Fixed Single Stretch Image |
Event Program
Public Class Form1
Dim FILE_NAME As String = Application.StartupPath & "\Image\"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process.Start("Desk.cpl")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Process.Start("Sysdm.cpl")
Dim LoadPicture As New Bitmap(FILE_NAME & "System Properties.jpg")
PictureBox1.Image = LoadPicture
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Process.Start("Timedate.cpl")
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Process.Start("Mmsys.cpl")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Process.Start("Main.cpl")
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Process.Start("Intl.cpl")
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Process.Start("AppWiz.cpl")
End Sub
Private Sub Button2_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.MouseHover
Dim LoadPicture As New Bitmap(FILE_NAME & "System Properties.jpg")
PictureBox1.Image = LoadPicture
End Sub
Private Sub Button6_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.MouseHover
Dim LoadPicture As New Bitmap(FILE_NAME & "Regional Settings Properties.jpg")
PictureBox1.Image = LoadPicture
End Sub
Private Sub Button3_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.MouseHover
Dim LoadPicture As New Bitmap(FILE_NAME & "DateTime Properties.jpg")
PictureBox1.Image = LoadPicture
End Sub
Private Sub Button5_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.MouseHover
Dim LoadPicture As New Bitmap(FILE_NAME & "Mouse Properties.jpg")
PictureBox1.Image = LoadPicture
End Sub
Private Sub Button1_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
Dim LoadPicture As New Bitmap(FILE_NAME & "Display Properties.jpg")
PictureBox1.Image = LoadPicture
End Sub
Private Sub Button4_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.MouseHover
Dim LoadPicture As New Bitmap(FILE_NAME & "Multimedia Properties.jpg")
PictureBox1.Image = LoadPicture
End Sub
Private Sub Button7_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.MouseHover
Dim LoadPicture As New Bitmap(FILE_NAME & "AddRemove Programs.jpg")
PictureBox1.Image = LoadPicture
End Sub
End Class
4. Klik tombol “Start Debuging” atau tekan tombol “F5” pada Keyboard untuk menjalankan aplikasi.
Label: VB.NET
0 Komentar:
Posting Komentar
Berlangganan Posting Komentar [Atom]
<< Beranda