Tutorial Visual Basic |Aplikasi Kursus

0

Langsung aja ya sob ke Te Ka Pe…
dah mulai boring ne…!!!!! heeee biasa… capek kuliah..!
semangat ya……..!

buat format seperti gambar berikut “:
1

kemudian get code ===>

copy + paste kan aja ya sob :

Option Explicit
Dim hrgtutor As Long

Private Sub Command1_Click()
hrgtutor = 0

If Option1.Value = True Then
hrgtutor = 275000
End If
If Option2.Value = True Then
hrgtutor = 255000
End If
If Option3.Value = True Then
hrgtutor = 295000
End If
If Option4.Value = True Then
hrgtutor = 273000
End If

Text3.Text = hrgtutor

End Sub

Private Sub Form_Load()
cbokuliah.AddItem “Statistika”
cbokuliah.AddItem “Perpajakan”
cbokuliah.AddItem “Akuntansi BIaya”
cbokuliah.AddItem “Hukum BIsnis”
End Sub

klik F5, Lihat hasil nya :

2

sukses ya sobat, jangan lupa di like dan share…!
semoga semua cita” kita tercapai, *amin*

Read more at radinalvbasic…..

Membuat Menu Sederhana Menggunakan Visual Basic 6.0

0

1untuk kali ini saya akan membuat menu sederhana menggunakan visual basic 6.0,
kalau kemaren saya posting tentang membuat 2 jenis pilihan huruf pada visual basic, kali ini agak melenceng dulu…
kita bahas tentang makanan & minuman…
hehehhehheeee :D

1. buka program visual basic anda.
2. setelah anda buka >> new project
3. klik LABEL >> ketikkan “CAFE IPI”
4. buat 2 FRAME >> “makan” & “minum”
5. pada FRAME “makan”
Masukkan OPTION BUTTON : >> bakso
>> nasi goreng
>> lontong
6. Pada FRAME “minum”
Masukkan CHECKBOX : >> Jus
>> Aqua
>> Teh Botol
7. Klik COMMAND BUTTON >> OK
8. Klik LABEL >> Total Bayar >> Text Box

“VIEW CODE”

9. Copy + Pastekan Text berikut :

Option Explicit
Dim hrgmakan As Long
Dim hrgminum As Long

Private Sub CMDOK_Click()
hrgmakan = 0
hrgminum = 0

If OPTBK.Value = True Then
hrgmakan = 1000
End If

If OPTng.Value = True Then
hrgmakan = 2000
End If
If optlt.Value = True Then
hrgmakan = 3000
End If

If chkjs.Value = 1 Then
hrgminum = hrgminum + 100
End If
If chkaq.Value = 1 Then
hrgminum = hrgminum + 200
End If

If chktb.Value = 1 Then
hrgminum = hrgminum + 300
End If

TXTTB.Text = hrgmakan + hrgminum
End Sub

10. Play…!!!
(catatan : ketentuan harga langsung dalam Rumus)

Selamat Mencoba gan…!

Rumus ShutDown Visual Basic 6.0

0

Shutdown restart logoff the local machine

The following API Declares and Constants can be used to force a PC to restart. Note, a demonstration routine can be found at the end of this post.

Private Declare Function ExitWindowsEx Lib “user32″ (ByVal uFlags as Long, ByVal wReserved as Long) as Long

Private Const EWX_FORCE = 4 ‘Force any applications to quit instead of prompting the user to close them.
Private Const EWX_POWEROFF = 8 ‘Shut down the system and, if possible, turn the computer off.
Private Const EWX_LOGOFF = 0 ‘Log off the network
Private Const EWX_REBOOT = 2 ‘Perform a full reboot of the system
Private Const EWX_SHUTDOWN = 1 ‘Shut down the system

‘Purpose : Forces a machine shut down/logoff
‘Inputs : [lShutDownType] If unspecified, will reboot the machine else one of the above constants
‘Outputs : If successful returns a number other than zero
‘Notes : If this fails check the value of Err.LastDllError. If this is 1314 then
‘ the you do not have sufficient privileges to call this function.

Function MachineShutDown(Optional lShutDownType As Long = EWX_REBOOT) As Long
MachineShutDown = ExitWindowsEx(lShutDownType, 0&) ‘shut down the computer
End Function

‘Purpose : Forces a machine shut down/logoff
‘Inputs : N/A
‘Outputs : N/A
‘Notes : DOESN’T REQUIRE ANY PRIVILAGES

Sub MachineShutDown2()
Shell “rundll32.exe user32.dll, ExitWindowsEx”, vbHide
End Sub

‘Demonstration routine
Sub Test()
‘Forces the computer to reboot
‘When the EWX_FORCE flag is set, Windows does not send the messages WM_QUERYENDSESSION and
‘WM_ENDSESSION to the applications currently running in the system. This can cause the
‘applications to lose data. Therefore, you should only use this flag in an emergency.
Call MachineShutDown(EWX_FORCE Or EWX_REBOOT)
‘Forces the user to log off
Call MachineShutDown(EWX_LOGOFF)
‘Shuts the computer down (no restart)
Call MachineShutDown(EWX_SHUTDOWN)
‘Shuts the computer down and turns power off (if possible)
Call MachineShutDown(EWX_POWEROFF)
End Sub

Membuat Aplikasi Shutdown pada Visual Basic 6.0

0

Berikut ini adalah cara dan langkah-langkah dalam pembuatan aplikasi shutdown :
- Buka Microsoft Visual Basic 6.0
- Akan muncul jendela seperti dibawah :

- Pilih standart Exe, kemudian klik tombol Open, maka akan muncul area kerja Visual Basic 6.0

- Dari gambar diatas, tambahkan 3 buah Command Button dari toolbox ke desain form
- Ubah juga nilai propertis pada masing-masing objek :
- Form1 :
- Caption : Aplikasi Shutdown
- MaxButton : False
- MinButton : False
- BorderStyle : 1-FixedSingle
- Command1 :
- (Name) : Cmd_Shutdown
- Caption : Shutdown
- Command2 :
- (Name) : Cmd_Restart
- Caption : Restart
   – Command3 :
- (Name) : Cmd_LogOff
- Caption : Log Off
- Jika Command button telah ditambahkan dan nilai properties dari masing-2 objek telah diatur, sekarang atur desain form seperti gambar dibawah :

 

- Jika form telah didesain seperti diatas, sekarang saatnya untuk penulisan listing code dengan cara menekan F7 atau mengklik 2x salah satu objek. kemudian ketikkan listing dibawah :

Private Sub Cmd_Logoff_Click()
    Call Shell(“C:WindowsSystem32Shutdown.exe -l -t 00″, vbHide)
End Sub
Private Sub Cmd_Restart_Click()
Call Shell(“C:WindowsSystem32Shutdown.exe -r -t 00″, vbHide)
End Sub
Private Sub Cmd_Shutdown_Click()
Call Shell(“C:WindowsSystem32Shutdown.exe -s -t 00″, vbHide)
End Sub 

Catatan :” Jangan Salah Memasukkan Kode nya”

Keterangan :
-s = shutdown
-r = restart
-l = logoff
-t 00 = interval waktu antara penekanan tombol shutdown dengan pemanggilan perintah shutdown.exe

Tq… Semoga Bermanfaat…!!!