Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

1 Temmuz 2005 Cuma

Resizable UserForm [System & Optional]



'UserForm1

Option Explicit
Dim EkranDüzenleme As New Class1

Private Sub UserForm_Initialize()
On Error Resume Next
Me.BackColor = RGB(251, 241, 241)
Me.Caption = "[PBİD ®]Resizable UserForm"
Set EkranDüzenleme.Çerçeve1 = Me
End Sub
Private Sub UserForm_Activate()
On Error Resume Next
Me.Left = (Application.Width - Me.Width) / 2
Me.Top = (Application.Height - Me.Height) / 2
End Sub
Private Sub UserForm_Resize()
On Error Resume Next
Me.Left = (Application.Width - Me.Width) / 2
Me.Top = (Application.Height - Me.Height) / 2
End Sub
'Module1

Private Sub Aç()
On Error Resume Next
UserForm1.Show Modal
End Sub
'Class1

Option Explicit
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 Çerçeve As Long
Private Tarz As Long

Public Property Set Çerçeve1(Ekran As Object)
On Error Resume Next
Çerçeve = FindWindow(vbNullString, Ekran.Caption)
Tarz = GetWindowLong(Çerçeve, (-16))
Tarz = Tarz Or &H80000 Or &H20000 Or &H10000
SetWindowLong Çerçeve, (-16), Tarz
ShowWindow Çerçeve, 5
DrawMenuBar Çerçeve
End Property

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul