“Program Launcher” dengan Visual Basic 6.0
Mungkin aplikasi ini sudah tidak asing bagi teman-teman. Khususnya bila windows teman-teman di tambahkan tema sehingga dapat menjalankan aplikasi yang di butuhkan. Berawal dari pemikiran itu, maka saya coba kembangkan dengan Visual Basic 6 dan ternyata bisa. Walaupun aplikasi ini sederhana tetapi dapat teman-teman modifikasi sesuai dengan keinginan. Seperti yang terlihat pada gambar di sebelah, saya mencontohkan menjalankan aplikasi berbasis windows, pada dasarnya aplikasi ini dapat melakukan lebih dari pada itu. Penasaran? coba teman-teman coba sendiri
1. Jalankan aplikasi Visual Basic 6.0
2. Pada jendela “New Project” pilih “Standard EXE” kemudian tekan tombol “Open”
3. Berikut setingan kontrol properti yang terdapat pada aplikasi ini
Object | Name | Properties | Setting |
Form | Form1 | Border Style | 1 - Fixed Single |
Caption | Program Launcher | ||
Font | Tahoma; 10pt | ||
Start Up Position | 2 - Center Screen | ||
Command Button | cmdWindowsExplorer | Caption | Windows Explorer |
Picture | explorer.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdMediaPlayer | Caption | Media Player |
Picture | player.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdInternetExplorer | Caption | Internet Explorer |
Picture | ie.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdVolumeControl | Caption | Volume Control |
Picture | vol.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdCalculator | Caption | Calculator |
Picture | calc.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdNotepad | Caption | Notepad |
Picture | notepad.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdWordPad | Caption | WordPad |
Picture | wordpad.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdPaint | Caption | Paint |
Picture | paint.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdOnScreenKeyboard | Caption | On-Screen Keyboard |
Picture | key.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdCommandPrompt | Caption | Command Prompt |
Picture | com.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdSolitaire | Caption | Solitaire |
Picture | sol.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdFreeCell | Caption | FreeCell |
Picture | freecl.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdMinesweeper | Caption | Minesweeper |
Picture | mines.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdHearts | Caption | Hearts |
Picture | heart.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdSpiderSolitaire | Caption | Spider Solitaire |
Picture | spider.jpg | ||
Style | 1 - Graphical | ||
Command Button | cmdPinball | Caption | Pinball |
Picture | pinball.jpg | ||
Style | 1 - Graphical |
4. Berikut event program aplikasi ini:
Dim Target
Private Sub 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 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 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 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 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 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 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 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 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 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 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
Private Sub 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 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 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 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 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
Label: VB6
0 Komentar:
Posting Komentar
Berlangganan Posting Komentar [Atom]
<< Beranda