“Program Launcher” dengan Visual Basic.NET 2010
Setelah sebelumnya saya terapkan dalam Visual Basic 6.0 sekarang saya terapkan pada Visual Basic.NET 2010. Tidak ada yang berbeda pada perancangan maupun pemrograman. Yang jelas membedakannya yaitu setingan properti controlnya saja. Bila di antara teman-teman mempunyai saran dan masukan. Saya sangat berterima kasih karena saya rasa aplikasi ini sederhana sekali. Maksudnya agak kurang geregetnya. Jadi bila teman-teman mempunyai ide tolong beritahukan saya. Trims.
 
1. Jalankan terlebih dahulu aplikasi Visual Basic 2010
2. Pada tabulasi “Start Page” pilih “New Project” atau bisa juga dengan menekan tombol “Ctrl + N” pada keyboard
3. Pada jendela “New Project” pilih “Windows Forms Application” kemudian tekan tombol “OK”
4. Berikut setingan kontrol properti yang terdapat pada aplikasi ini
| Object | Name | Properties | Setting | 
| Form | Form1 | Font | Tahoma; 10pt | 
| Form Border Style | Fixed Single | ||
| Maximize Box | False | ||
| Minimize Box | False | ||
| Start Position | Center Screen | ||
| Text | Program Launcher | ||
| Button | cmdWindowsExplorer | Image | explorer.jpg | 
| Image Align | Top Center | ||
| Text | Windows Explorer | ||
| Text Align | Bottom Center | ||
| Button | cmdMediaPlayer | Image | player.jpg | 
| Image Align | Top Center | ||
| Text | Media Player | ||
| Text Align | Bottom Center | ||
| Button | cmdInternetExplorer | Image | ie.jpg | 
| Image Align | Top Center | ||
| Text | Internet Explorer | ||
| Text Align | Bottom Center | ||
| Button | cmdVolumeControl | Image | volume.jpg | 
| Image Align | Top Center | ||
| Text | Volume Control | ||
| Text Align | Bottom Center | ||
| Button | cmdCalculator | Image | calc.jpg | 
| Image Align | Top Center | ||
| Text | Calculator | ||
| Text Align | Bottom Center | ||
| Button | cmdNotepad | Image | notepad.jpg | 
| Image Align | Top Center | ||
| Text | Notepad | ||
| Text Align | Bottom Center | ||
| Button | cmdWordPad | Image | wordpad.jpg | 
| Image Align | Top Center | ||
| Text | WordPad | ||
| Text Align | Bottom Center | ||
| Button | cmdPaint | Image | paint.jpg | 
| Image Align | Top Center | ||
| Text | Paint | ||
| Text Align | Bottom Center | ||
| Button | cmdOnScreenKeyboard | Image | keyb.jpg | 
| Image Align | Top Center | ||
| Text | On-Screen Keyboard | ||
| Text Align | Bottom Center | ||
| Button | cmdCommandPrompt | Image | comm.jpg | 
| Image Align | Top Center | ||
| Text | Command Prompt | ||
| Text Align | Bottom Center | ||
| Button | cmdSolitaire | Image | solitaire.jpg | 
| Image Align | Top Center | ||
| Text | Solitaire | ||
| Text Align | Bottom Center | ||
| Button | cmdFreeCell | Image | freecell.jpg | 
| Image Align | Top Center | ||
| Text | FreeCell | ||
| Text Align | Bottom Center | ||
| Button | cmdMinesweeper | Image | mines.jpg | 
| Image Align | Top Center | ||
| Text | Minesweeper | ||
| Text Align | Bottom Center | ||
| Button | cmdHearts | Image | heart.jpg | 
| Image Align | Top Center | ||
| Text | Hearts | ||
| Text Align | Bottom Center | ||
| Button | cmdSpiderSolitaire | Image | spider.jpg | 
| Image Align | Top Center | ||
| Text | Spider Solitaire | ||
| Text Align | Bottom Center | ||
| Button | cmdPinball | Image | pinball.jpg | 
| Image Align | Top Center | ||
| Text | Pinball | ||
| Text Align | Bottom Center | 
5. Berikut event code program
Public Class Form1
    Dim Target  
    Private Sub cmdWindowsExplorer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdWindowsExplorer.Click
        Target = "C:\WINDOWS\explorer.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdMediaPlayer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMediaPlayer.Click
        Target = "C:\Program Files\Windows Media Player\wmplayer.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdInternetExplorer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdInternetExplorer.Click
        Target = "C:\Program Files\Internet Explorer\IEXPLORE.EXE"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdVolumeControl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdVolumeControl.Click
        Target = "C:\WINDOWS\system32\sndvol32.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdCalculator_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCalculator.Click
        Target = "C:\WINDOWS\system32\calc.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdNotepad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdNotepad.Click
        Target = "C:\WINDOWS\system32\notepad.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdWordPad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdWordPad.Click
        Target = "C:\Program Files\Windows NT\Accessories\wordpad.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdPaint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPaint.Click
        Target = "C:\WINDOWS\system32\mspaint.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdOnScreenKeyboard_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOnScreenKeyboard.Click
        Target = "C:\WINDOWS\system32\osk.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdCommandPrompt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCommandPrompt.Click
        Target = "C:\WINDOWS\system32\cmd.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdSolitaire_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSolitaire.Click
        Target = "C:\WINDOWS\system32\sol.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdFreeCell_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFreeCell.Click
        Target = "C:\WINDOWS\system32\freecell.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdMinesweeper_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMinesweeper.Click
        Target = "C:\WINDOWS\system32\winmine.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdHearts_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdHearts.Click
        Target = "C:\WINDOWS\system32\mshearts.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdSpiderSolitaire_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSpiderSolitaire.Click
        Target = "C:\WINDOWS\system32\spider.exe"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub  
    Private Sub cmdPinball_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPinball.Click
        Target = "C:\Program Files\Windows NT\Pinball\PINBALL.EXE"  
        If Dir(Target) = "" Then
            MsgBox("File not found", vbInformation, "Information")
        Else
            Shell(Target, vbNormalFocus)
        End If
    End Sub
End Class
Label: VB.NET


0 Komentar:
Posting Komentar
Berlangganan Posting Komentar [Atom]
<< Beranda