Slik fjerner den blå tittellinja Fra Userform i Excel 2003
Opprette et brukerskjema i Microsoft Excel 2003 legger automatisk den blå User Form tittellinjen øverst i skjemaet vinduet. Du kan tilpasse utseendet til Excel-bruker skjemaet ved å fjerne tittellinjen fra skjemaet vinduet. For å slette "User Form" tittellinjen, kan du bruke Microsoft Visual Basic Editor til å endre brukerskjemaet modulens kode.
Bruksanvisning
1 Start Microsoft Excel 2003. Trykk "Alt" og "F11" tastene på tastaturet samtidig for å starte Microsoft Visual Basic Editor søknad inne Excel.
2 Klikk "Sett inn" i hovednavigasjonsmenyen. Velg "Userform" fra rullegardinmenyen.
3 Dobbeltklikk på "UserForm1" vinduet for å åpne kodevinduet. Marker og slett noen kode i vinduet.
4 Lim inn følgende kode i vinduet:
Option Explicit
Private Sub UserForm_Initialize ()
Call RemoveCaption(Me)
End Sub
5 Klikk "Sett inn" i hovednavigasjonsmenyen. Velg "Module" fra rullegardinmenyen.
6 Lim inn følgende kode i modulen vinduet:
Option Explicit
Private Declare Function FindWindow Lib "User32"
Alias "FindWindowA" (
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "User32"
Alias "GetWindowLongA" (
ByVal hwnd Som Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32"
Alias "SetWindowLongA" (ByVal hwnd As Long,
ByVal nIndex Som Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "User32" (_
ByVal hwnd As Long) As Long
Sub RemoveCaption (objForm As Object)
Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long
Hvis Val (Application.Version) & lt; 9 Da
mhWndForm = FindWindow (& quot; ThunderXFrame & quot ;, objForm.Caption) 'XL97
Ellers
mhWndForm = FindWindow (& quot; ThunderDFrame & quot ;, objForm.Caption) 'XL2000 +
Slutt om
lStyle = GetWindowLong (mhWndForm, -16)
lStyle = lStyle og ikke & amp; HC00000
SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm
End Sub
Sub ShowForm ()
UserForm1.Show False
End Sub
7 Klikk på "x" knappen øverst i høyre hjørne av Visual Basic Editor vinduet for å lukke programmet og alle vinduer. Du trenger ikke å lagre innholdet av kodebokser.
8 Klikk "Verktøy" i hovedmenyen. Velg "makro" etterfulgt av "Makroer". Velg "ShowForm." Klikk "Kjør" -knappen. Excel bruker skjemaet viser nå uten tittellinjen.