Archive for the ‘Visual Basic’ Category

Disable tombol Close X pada form

Option Explicit

Private Declare Function DeleteMenu Lib “user32″ (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib “user32″ (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Const MF_BYPOSITION = &H400&

Private ReadyToClose As Boolean
Private Sub RemoveMenus(frm As Form, remove_restore As Boolean, remove_move As Boolean, remove_size As Boolean, remove_minimize As Boolean, remove_maximize As Boolean, remove_seperator As Boolean,
remove_close As Boolean)
Dim hMenu As Long

‘ Mengambil dari menu handle pada form
hMenu = GetSystemMenu(hwnd, False)

If remove_close Then DeleteMenu hMenu, 6, MF_BYPOSITION
If remove_seperator Then DeleteMenu hMenu, 5, MF_BYPOSITION
If remove_maximize Then DeleteMenu hMenu, 4, MF_BYPOSITION
If remove_minimize Then DeleteMenu hMenu, 3, MF_BYPOSITION
If remove_size Then DeleteMenu hMenu, 2, MF_BYPOSITION
If remove_move Then DeleteMenu hMenu, 1, MF_BYPOSITION
If remove_restore Then DeleteMenu hMenu, 0, MF_BYPOSITION
End Sub

Private Sub cmdClose_Click()
ReadyToClose = True
Unload Me
End Sub

Private Sub Form_Load()
‘ Menghapus sistem close pada menu separator.
RemoveMenus Me, False, False, _
False, False, False, True, True
End Sub

‘ Batalkan jikaReadyToClose dalam modus false.
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = Not ReadyToClose
End Sub

Form “Always on Top”

Deklarasi

Declare Function SetWindowPos& Lib “user32″ (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

Code yang digunakan

‘Code ini akan menampilkan form selalu didepan
rtn = SetWindowPos(OnTop.hwnd, -2, 0, 0, 0, 0, 3)

‘Code ini untuk mengembalikan fungsi diatas
rtn = SetWindowPos(OnTop.hwnd, -1, 0, 0, 0, 0, 3)

Cara Menjalankan : Copy code di bawah pada form code)

Declare Function SetWindowPos& Lib “user32″ (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

Private Sub Form_Load()
this code makes the window stay on top
rtn = SetWindowPos(OnTop.hwnd, -2, 0, 0, 0, 0, 3)
End Sub

Cek kecepatan akses form

‘*******************************************************
‘ Paste This code in the module don’t in form_Load
‘ Change Start object as sub main
‘ For check speed form : run the form for the first time and look how many you get access on speed form.
‘ Step two load picture or large picture in form and then check again how many form speed is u get.
‘*******************************************************

Private Declare Function GetTickCount Lib “kernel32″ () As Long

Sub main()
Dim lSpeedTime As Long
Dim SInfoSpeed As String
lSpeedTime = GetTickCount
Load Form1
Form1.Show
lSpeedTime = GetTickCount – lSpeedTime

‘ this is only simulation
If lSpeedTime <= 50 Then
SInfoSpeed = “[Very Fast]”
ElseIf lSpeedTime >= 50 And lSpeedTime <= 100 Then
SInfoSpeed = “[Normal]”
ElseIf lSpeedTime >= 100 And lSpeedTime <= 200 Then
SInfoSpeed = “[Slow]”
ElseIf lSpeedTime >= 200 Then
SInfoSpeed = “[Very Slow]”
End If

Form1.Caption = “Time Speed Form: ” & lSpeedTime & ” Milliseconds – ” & SInfoSpeed
End Sub

Software Development
Selain program-program yang kami tampilkan di blog ini, anda juga bisa memesan program yang sesuai dengan keperluan bisnis anda.

Informasi lebih lanjut, anda bisa menghubungi kami...

Salam,
YS-Soft Labs
Kontak
Nama : Yuddy Astiono
E-mail : yuddy_thio@yahoo.co.id
Phone : 0811510454


programming


ShoutMix chat widget

Web Site Statistics
VISITORS


free web counter
Program YS-Bel Sekolah
Fitur-fitur :
* OsenXPSuite2009 Original
* Suara bel Indonesia & Inggris
* Ada kategori (normal,ujian,dll)
* Tidak ada batasan jumlah bel
* Tidak ada batasan jumlah jadwal
* Menu khusus utk atur jadwal bel
* Suara bel bisa bunyi berulang
* Pengaturan auto running/startup
* dan masih byk lagi fitur lainnya....

Fitur di atas bisa dikembangkan lagi sesuai kebutuhan sekolah anda...
Silahkan hubungi kami...
Bank Support

CIMB Niaga Cab.Banjarmasin
N a m a : Yuddy Astiono
No Rek. : 443010099****


BNI Cab.Banjarmasin
N a m a : Yuddy Astiono
No Rek. : 008150****


Mandiri Cab.A.Yani Banjarmasin
N a m a : Yuddy Astiono
No Rek. : 031-00-0670***-*
Other Business
Partner YS-Soft Labs
AraySoft
Araysoft Labs (Gautama Yustitia)
Jakarta Timur

Cimahi-One
Cimahi-One (Tatang Sutarman)
Cimahi - Jawa Barat

BrajaTechnology
BRAJA Technology
Cikeusal - Jawa Barat

Master-Delphi
Edy Software (Edy Sutrisno)
Jember - Jawa Timur

GenerasiComputer
Generasi Computer (Yopie.S)
Medan - Sumatera Utara

NajlaPonsel
Najla Ponsel (Fendy)
Landasan Ulin - Kalimantan Selatan
Forum Support
i-bego
Kategori
Informasi Koneksi
  
  




free visitor counter