Pada form yang biasa hal ini tentulah sangat mudah untuk dilakukan, karena kita tinggal set didalam Properti nya BorderStyle = 0 - None, tapi lain hal nya dengan MDI Form, untuk menghilangkan Title Bar pada MDI Form kita perlu memanggil beberap fungsi API.
Tambahlah sebuah MDI Form kedalam project melalui Project -> Add MDI Form, dan sebuah Module melalui menu Project -> Add Module
Double klik Module1, dan ketikkan kode berikut :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| Private Declare Function GetWindowLong Lib "USER32" Alias _"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib "USER32" Alias _"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _ByVal dwNewLong As Long) As LongPrivate Const GWL_STYLE = (-16)Private Const WS_BORDER = &H800000Private Const WS_CAPTION = &HC00000Public Sub MDINoBorder(ByRef nFormHWND As Long)Dim sHandle As LongOn Error GoTo errMDINoBordersHandle = GetWindowLong(nFormHWND, GWL_STYLE)sHandle = sHandle And Not WS_CAPTIONSetWindowLong nFormHWND, GWL_STYLE, sHandleExit SuberrMDINoBorder: MsgBox "[" & Err.Number & "] - " & Err.Description, _ vbExclamation, "MDI No Border Error"End Sub |
Lalu double klik MDIForm1, dan ketikkan kode berikut :
1
2
3
| Private Sub MDIForm_Activate() MDINoBorder Me.hwndEnd Sub |
Sebelum project kita jalan kan anda tentukan dulu StartUp Object nya berada pada MDIForm1, cara nya dari menu Project -> Project1 Properties..., dan pastikan pada opsi StartUp Object anda pilih MDIForm1
Jalankan project dengan menekan tombol F5, dan lihat hasilnya nah sekarang MDIForm pada project anda tidak memiliki Title Bar, seluruh form milik anda, terserah mau di isi dengan apa
Thank's for reading the articelCara Menghilangkan Judul MDI Form atau Title Bar VB6 .If You want to copy paste your website please tag my link Cara Menghilangkan Judul MDI Form atau Title Bar VB6 Intro My Website.

0 comments:
Post a Comment