AW: Userform auf volle Excelfenstergröße
12.01.2006 12:02:06
Reinhard
Hallo,
ich habe während du geantwortest hast weiteren Code gefunden, der funktioniert im Codemodul der UF. K.A. warum der und der andere nicht.
Zum funktionierenden Code. Ich will es an sich so haben wie dort, also linke Hälfte der Browser, rechts der Rest der UF.
Aber die Taskleiste unten muss sichtbar bleiben und wie starte ich links nicht den IE sondern den jeweiligen Standardbrowser.
Gruß
Reinhard
Funtioniert:
Option Explicit
Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "user32" _
(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 Sub UserForm_Initialize()
Dim Titel$, Suchstring$, Fensterhandle&
Dim cx&, cy&
Suchstring = "QWERYT"
Titel = Me.Caption
Me.Caption = Suchstring
Fensterhandle = FindWindow(vbNullString, Suchstring)
Me.Caption = Titel
cx = GetSystemMetrics(0)
cy = GetSystemMetrics(1)
SetWindowPos Fensterhandle, 1, 0, 0, cx, cy, 0
WebBrowser1.Top = Me.Top
WebBrowser1.Left = Me.Left
WebBrowser1.Height = Me.Height
WebBrowser1.Width = Me.Width / 2
End Sub
Funtioniert nicht (Fehler bei Komilieren wegen "Declare")
Option Explicit
Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Const SM_CXSCREEN = 0
Const SM_CYSCREEN = 1
Private Sub UserForm_Initialize()
UserForm.Left = 0
UserForm.Top = 0
UserForm.Height = GetSystemMetrics(SM_CYSCREEN)
UserForm.Width = GetSystemMetrics(SM_CXSCREEN)
End Sub