home *** CD-ROM | disk | FTP | other *** search
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "SizeAll"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
-
- Private Const WidthProp = "Width"
- Private Const HeightProp = "Height"
- Public SizeFlags As Integer '1=Width, 2=Height, 3=Both
- Public VBInstance As VBIDE.Application
-
- Public Sub AfterClick()
- Dim ControlIterator As Object
- Dim Control As VBIDE.ControlTemplate
- Dim NewWidth As Long
- Dim NewHeight As Long
- Dim bHaveNewValues As Boolean
-
- 'If a property access fails, then just ignore it.
- On Error Resume Next
-
- bHaveNewValues = False
- For Each ControlIterator In VBInstance.ActiveProject.ActiveForm.SelectedControlTemplates
- Set Control = ControlIterator
- With Control.Properties
- If bHaveNewValues Then
- If SizeFlags And 1 Then .Item(WidthProp) = NewWidth
- If SizeFlags And 2 Then .Item(HeightProp) = NewHeight
- Else
- If SizeFlags And 1 Then NewWidth = .Item(WidthProp)
- If SizeFlags And 2 Then NewHeight = .Item(HeightProp)
- bHaveNewValues = True
- End If
- End With
- Next
- End Sub
-