Berikut ini adalah cara men-disabled tombol maximize di MDIForm di visual basic 6, untuk mempraktekannya siapkan :
1. Buat 1 Project baru dengan 1 MDIForm.2. Copy-kan coding berikut ke dalam editor MDIForm yang bertalian.
Option Explicit
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) _
As Long
Private Const GWL_STYLE = (-16)
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Public Sub NoMaxBox(f As MDIForm)
Dim l As Long
l = GetWindowLong(f.hWnd, GWL_STYLE)
l = l And Not (WS_MAXIMIZEBOX)
l = SetWindowLong(f.hWnd, GWL_STYLE, l)
End Sub
Public Sub NoMinBox(f As MDIForm)
Dim l As Long
l = GetWindowLong(f.hWnd, GWL_STYLE)
l = l And Not (WS_MINIMIZEBOX)
l = SetWindowLong(f.hWnd, GWL_STYLE, l)
End Sub
Private Sub MDIForm_Load()
NoMaxBox Me
'NoMinBox Me
End Sub
Private Sub MDIForm_Resize()
'Ganti 4800 di bawah dgn lebar form yg fix Anda tentukan
'Ganti 3600 di bawah dgn tinggi form yg fix Anda tentukan
If Me.Width <> 4800 Then Me.Width = 4800
If Me.Height <> 3600 Then Me.Height = 3600
End Sub
Tags:
contoh program vb6, contoh fungsi di vb6, cara penggunaan fungsi vb, tutorial vb6, download tutorial vb6, vb6 tutorial download, dasar dasar vb6, belajar vb6, cara mudah belajar vb6, vb6 artikel download, vb6 blog, contoh program vb6, artikel vb6, semua tentang vb6, vb6 api, cara menggunakan module, cara menggunakan class module
0 komentar:
Posting Komentar