Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

10 Temmuz 2005 Pazar

Resizable UserForm [System & NotOptional]


'UserForm1
Option Explicit
Dim objFormResize As New Class1

Private Sub UserForm_Initialize()
On Error GoTo Hata
Me.Caption = "[PBİD®] Resizable User Form..."
Hata:
End Sub
Private Sub UserForm_Activate()
On Error Resume Next
Set objFormResize.Form = Me
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
Dim Pencere As Long, Tarz As Long

Public Property Set Form(objForm As Object)
On Error Resume Next
Pencere = FindWindow(vbNullString, objForm.Caption)
Call SetUserFormStyle
End Property
Private Sub SetUserFormStyle()
On Error Resume Next
Tarz = GetWindowLong(Pencere, (-16))
Tarz = Tarz Or &H80000 Or &H20000 Or &H10000
SetWindowLong Pencere, (-16), Tarz
ShowWindow Pencere, 5
DrawMenuBar Pencere
End Sub

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