userformu otomatik boyutlandırma [Archive] - Excel Forum

PDA

Tüm Versiyonu Göster : userformu otomatik boyutlandırma


tevfikseremet
26-10-2004, 12:58
15 " ekrana göre ayarladığım userform 17" monitörde küçük olarak ekrana geliyor. Tekrar boyutlarını ayarlamak gerekiyor. userformu otomatik nasıl boyutlandırabilirim.

xxrt
26-10-2004, 13:48
Fullscren ile ama bu seferde userin üzerindeki nesneler farklılık gösterecek.Çözümü yok.VB Kullanırsan olur.. :hihoho:
Bu kodları kod sayfanın en başına yazarsan 3 Düğme oluşur.Kullanıcı istediği gibi büyütür küçültür.

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 As Long, ByVal nIndex 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 Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
'
Private Sub UserForm_Activate()
Dim hWndForm As Long, frmStyle As Long
hWndForm = FindWindow(vbNullString, Me.Caption)
frmStyle = GetWindowLong(hWndForm, (-16))
frmStyle = frmStyle Or &H80000 Or &H20000 Or &H10000
SetWindowLong hWndForm, (-16), frmStyle
ShowWindow hWndForm, 5
DrawMenuBar hWndForm
End Sub

Ayrı bir kod ise Userformun açılışında tam ekran olarak gelmesi.

Private Sub UserForm_Initialize()
With Application
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Width = .Width
End With
End Sub

ALPEN
26-10-2004, 13:58
Private Sub UserForm_Initialize()
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With
End Sub


Özel Arama