Userformda Tam Ekran ve Boyutlandırma Özelliği

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,197
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Userformda Tam Ekran ve Boyutlandırma Ã?zelliği

Selamlar Arkadaşlar,

Birşey öğrenmek istiyorum. Ekte forumdan bulduğum bir çalışma var. Userforma eklenen sağ üst köşedeki 3 buton beraberinde ayrıca mouse yardımıyla boyutunu istediğimiz gibi değiştirebilirmiyiz. Ortadaki butona tıkladığımızda formun ekrandaki boyutu değişiyor bundan sonra mouse yardımıyla ben kendim formu dört yöndede boyutlandırabilirmiyim.
 
Katılım
21 Ekim 2005
Mesajlar
529
Excel Vers. ve Dili
2010 - TR!
COST_CONTROL, dostum bıldıgım kadarıyla exceldekı vısual basıc edıtorunde bunu yapamazsın :(
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,197
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Bende arama yapıp birkaç örnek bulmuştum fakat aradığım buydu çok teşekkür ederim. :arkadas:
 
Katılım
9 Nisan 2005
Mesajlar
158
Merhaba Arkadaşlar ,

Userform açılırken sadece minimize butonunun görünmesini , maximize butonunun görünmemesini nasıl sağlayabilirim ? Teşekkürler...
 

Haluk

Özel Üye
Katılım
7 Temmuz 2004
Mesajlar
12,406
Excel Vers. ve Dili
64 Bit 2010 - İngilizce
+
Google Sheets
+
JScript
Altın Üyelik Bitiş Tarihi
eksoy' Alıntı:
Userform açılırken sadece minimize butonunun görünmesini , maximize butonunun görünmemesini nasıl sağlayabilirim ?
Kod:
'// Define the API's
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 DrawMenuBar _
    Lib "user32" ( _
        ByVal hWnd As Long) _
As Long

Private Declare Function FindWindowA _
    Lib "user32" ( _
        ByVal lpClassName As String, _
        ByVal lpWindowName As String) _
As Long


Private Const GWL_EXSTYLE = (-20)              '// Extended Styles
Private Const GWL_STYLE As Long = (-16)        '// Sets a new window style

'// General Windows Styles Bits
Private Const WS_EX_APPWINDOW = &H40000        '// Sets Min Form to task bar
Private Const WS_SYSMENU As Long = &H80000     '// WinStyle Sys Menu
Private Const WS_MINIMIZEBOX As Long = &H20000 '// WinStyle_MaxButton
Private Const WS_MAXIMIZEBOX As Long = &H10000 '// WinStyle_MinButton

Dim lFrmWndHdl As Long
Dim lStyle As Long


Private Sub UserForm_Activate()
'// ==============================================//
'//  Adds Min/Max to Userform Window              //
'//  Modifications & comments by Ivan F Moala     //
'//  22/07/01                                     //
'//  Amended 9th May 2002 idea from Mark O'Brian  //
'//  FindwindowA use VBnull instead of ClassName  //
'//  negates having to get the class name!        //
'//                                               //
'//  06/09/2003: NB: Set Form to [Modal False]    //
'//  To fix this Tmp done                         //
'//  Really need to use the                       //
'//  WS_POPUP                                     //
'//  Hex 80000000                                 //
'// ==============================================//



lFrmWndHdl = FindWindowA(vbNullString, Me.Caption)

'// The GetWindowLong function retrieves information about the window.
'// The function also retrieves the 32-bit (long) value
'// into the extra window memory of a window.
lStyle = GetWindowLong(lFrmWndHdl, GWL_STYLE)

'// lStyle is the New window style so lets set it up with the following
lStyle = lStyle Or WS_SYSMENU          '// SystemMenu
lStyle = lStyle Or WS_MINIMIZEBOX      '// With MinimizeBox
' We are Removing this as per your original _
lStyle = lStyle Or WS_MAXIMIZEBOX      '// and MaximizeBox

'// Now lets set up our New window the SetWindowLong function changes
'// the attributes of the specified window , given as lFrmWndHdl,
'// GWL_STYLE = New windows style, and our Newly defined style = lStyle
SetWindowLong lFrmWndHdl, GWL_STYLE, (lStyle)

lStyle = GetWindowLong(lFrmWndHdl, GWL_EXSTYLE)
lStyle = lStyle Or WS_EX_APPWINDOW

'// Set the extended window style
SetWindowLong lFrmWndHdl, GWL_EXSTYLE, lStyle

'// The DrawMenuBar function redraws the menu bar of the specified window.
'// We need this as we have changed the menu bar after Windows has created it.
'// All we need is the Handle, so thats simply enougth
DrawMenuBar lFrmWndHdl
'// Need to set this to make the Form Take
AppActivate ("Microsoft excel")

End Sub
 
Üst