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.
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
Private Sub UserForm_Initialize()
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With
End Sub
vBulletin v3.7.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.