AW: blauer balken
07.05.2006 14:46:55
Reinhard
Hi Thomas,
mein Idee war die Titelleiste ganz wegzulassen, dann oben ein Textfeld Grafik o.ä. zu erstellen was die Titelleiste ersetzt, ggfs samt Schließkreuz.
Aus den beiden Links:
http://groups.google.de/group/microsoft.public.de.vb/browse_thread/thread/1002d1d7cbc650c3/ea61362c080cb7c2?lnk=st&q=userform+titelleiste+ausblenden&rnum=8&hl=de#ea61362c080cb7c2
http://www.vb-hellfire.de/knowlib/showcaption.php
bastelte ich mir nachfolgenden Code der auch im Sinne meiner Idee prächtig funktioniert, aber ein wenig *g übers Ziel hinausschießt
denn auch der Rest der UF ist unsichtbar :-)
Sie muss aber irgendwo vorhanden sein, denn man kann im Editor nichts ändern und auch
nihct in der Tabelle, erst wenn man im Editor mit Rechtsklick auf die UF Objekt zeigen
wählt geht alles wieder.
Naja, vielleicht können Erfahrere die UF sichtbar machen.
Private Declare Function GetForegroundWindow _
Lib "user32.dll" () As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long _
) As Long
Private Declare Function SetWindowPos Lib "user32.dll" ( _
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 _
) 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 As Long = (-16)
Private Const WS_CAPTION As Long = &HC00000
Public Property Get ShowCaption() As Boolean
Dim lhWnd As Long
lhWnd = GetForegroundWindow()
ShowCaption = (GetWindowLong(lhWnd, GWL_STYLE) _
And WS_CAPTION) = WS_CAPTION
End Property
Public Property Let ShowCaption(ByVal New_Value As Boolean)
Dim lngStyle As Long
Dim lhWnd As Long
lhWnd = GetForegroundWindow()
lngStyle = GetWindowLong(lhWnd, GWL_STYLE)
If (New_Value) Then
lngStyle = lngStyle Or WS_CAPTION
Else
lngStyle = lngStyle And Not WS_CAPTION
End If
SetWindowLong lhWnd, GWL_STYLE, lngStyle
SetWindowPos lhWnd, 0, 0, 0, 0, 0, SWP_REFRESH
End Property
Private Sub UserForm_Activate()
Me.ShowCaption = False
End Sub
Gruß
Reinhard
ps: Ich freue mich über eine Rückmeldung ob diese Antwort hilfreich war oder nicht..