Browse By

Menghilangkan Logo Close Pada MDI Form

Assalamualaikum..

sekarang saya ingin berbaig mengenai Coding Visual Basic 6.0 Lagi,oke.
mungkin temen2 kaLo bikin Menu utama Pake MDIForm..pasti ada Logo X / close kan..??
gimana sih caRanya biar iLang..

Kita harus menggunakan sebuah Coding Untuk Menghilangkan Logo tersebut..

ini dia codingnya :

Private Declare Function _
 GetSystemMenu Lib "user32" ( _
 ByVal hwnd As Long, _
 ByVal bRevert As Boolean) As Long

 Private Declare Function _
 GetMenuItemCount Lib "user32" ( _
 ByVal hMenu As Long) As Long

 Private Declare Function _
 RemoveMenu Lib "user32" ( _
 ByVal hMenu As Long, _
 ByVal nPosition As Long, _
 ByVal wFlags As Long) As Long

 Private Declare Function _
 DrawMenuBar Lib "user32" ( _
 ByVal hwnd As Long) As Long

 Private Const MF_BYPOSITION = &H400&
 Private Const MF_REMOVE = &H1000&

 Public Sub NonAktifClose(frm As Form, _
 Optional Disable As Boolean = True)
 Dim hMenu As Long
 Dim nCount As Long

 If Disable Then
 hMenu = GetSystemMenu(frm.hwnd, False)
 nCount = GetMenuItemCount(hMenu)
 Call RemoveMenu(hMenu, nCount - 1, MF_REMOVE Or _
 MF_BYPOSITION)
 Call RemoveMenu(hMenu, nCount - 2, MF_REMOVE Or _
 MF_BYPOSITION)
 DrawMenuBar frm.hwnd
 Else
 GetSystemMenu frm.hwnd, True
 DrawMenuBar frm.hwnd
 End If
 End Sub

Nah,oke kalo sudah menggunakan coding tersebut didalam Module yang teman – teman Buat..

Pemanggilan di MDIFormnya seperti apa ??

ini dia pemanggilannya :

[php]</p>
<p>&lt;code&gt;Private Sub MDIForm_Load()<br />
NonAktifClose Me, True<br />
End Sub&lt;/code&gt;</p>
<p>[/php]

Oke,simple kan ??

yap..selamat mencoba ya teman – teman semuanya..

Leave a Reply

Your email address will not be published. Required fields are marked *