This little VB example demonstrates the problem.
When the line for font sizing is remmed, pressing Command1 will increase the textbox size.
Converserly, pressing Command2 will decrement the textbox size.
However, when the line for font sizing is Un-Remmed (executed), prressing Command1 will increase the textbox size and font. However if Command2 is pressed the textbox continues to increases borh in size and font Instead of decreasing.
====================================
Code:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3075
ClientLeft = 60
ClientTop = 465
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3075
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 405
Left = 1230
TabIndex = 2
Top = 2565
Width = 2100
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 1245
TabIndex = 1
Top = 1965
Width = 2160
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1020
TabIndex = 0
Text = "Text1"
Top = 705
Width = 2790
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Increment As Single
Private Decrement As Single
Private Sub Command1_Click()
Dim a As Integer
Increment = Increment + 100
Text1.Height = Text1.Height + Increment
a = ScaleY(Text1.Height, vbTwips, vbPoints)
'<<<< UnRem next line to show problem >>>>>>
' Text1.Font.Size = a
Debug.Print "+"; Text1.Height; Increment; a; Text1.Font.Size
End Sub
Private Sub Command2_Click()
Dim a As Integer
Decrement = Decrement - 100
Text1.Height = Text1.Height + Decrement
a = ScaleY(Text1.Height, vbTwips, vbPoints)
<<<< UnRem next line to show problem >>>>>>
' Text1.Font.Size = a
Debug.Print "-"; Text1.Height; Decrement; a; Text1.Font.Size
End Sub