Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default TextBox 'ShrinkToFit' oddity ???

I've been pestered of late by what appears to be a
ShrinkToFit effect respecting text boxes on a MultiPage.
I recall encountering this in the past also.

In this case, the text boxes are tightly spaced. I don't
know if it is a requirement for the text boxes be on a
MultiPage and/or tightly spaced.

The following code will create a userform, add a MultiPage
and several tightly spaced text boxes. I believe it will
replicate the phenomenon for others.

I find that if the MultiPage height is set to 358, for
instance, the 11th level of textboxes appear to have type
7 font while the others are type 8. If I change the
height to either 356 or 359 it changes to the 4th level.
If I change it to 357 or 360 the problem goes away. Other
combinations of component dimensions/positions can also
effect this. Hoping someone can explain the logic.
Running xl2000.

Sub ShrinkToFitOddity()
Dim i As Integer, ii As Integer
Dim UF As Object, TB As Control, Multi As MultiPage
Set UF = Application.VBE. _
ActiveVBProject.VBComponents.Add(3)
UF.Properties("Height") = 400
UF.Properties("Width") = 130
Set Multi = UF.Designer.Controls.Add("Forms.MultiPage.1")
With Multi
..Height = 358 'Note effect when 356, 357, 358, 359 and 360
..Width = 115
..Top = 5
..Left = 5
End With
For i = 1 To 20
For ii = 0 To 1
Set TB = Multi.Pages(0).Controls.Add("Forms.TextBox.1")
With TB
..Font.Size = 8
..Left = 10 + ii * 50
..Top = i * 15 + 11
..Height = 15
..Width = 40
..Text = Format(Rnd, "0.00")
End With
Next ii
Next i
End Sub

TIA,
Greg
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A rounding oddity Bernard Liengme Excel Worksheet Functions 8 December 28th 06 07:07 AM
Excel oddity Dave B. Excel Discussion (Misc queries) 1 November 3rd 06 06:08 PM
An oddity if not a bug Harlan Grove Excel Worksheet Functions 21 July 17th 06 05:36 PM
Chart oddity Ron P Charts and Charting in Excel 2 February 16th 06 03:05 PM
Another Excel oddity Steve Excel Discussion (Misc queries) 5 January 5th 05 08:50 PM


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"