
Never seen this before.
I have two option buttons, if I togle between the two, listbox1 height shrinks.
It will go from 108.7 to finally togling between 11.8 and 12.6.

Private Sub OptionButton1_Click()
ListBox1.Height = "108.7" 'force list box height? (for testing)
MsgBox ListBox1.Height 'for testing
ListBox1.Clear
TextBox11.Font = "Tahoma"
SaveSetting "GdtFcfBuilder", "Variables", "sStdFont", OptionButton1.Value
SaveSetting "GdtFcfBuilder", "Variables", "sIMSFont", OptionButton2.Value
With ListBox1
.Font.Name = "Tahoma"
.Font.Size = "8"
.AddItem "- (Straigtness)"
.AddItem "Flat (Flatness)"
.AddItem "Rnd (Roundness)"
.AddItem "ProL (Profile Line)"
.AddItem "ProS (Profile Surface)"
.AddItem "Ang (Angularity)"
.AddItem "// (Parallelism)"
.AddItem "Per (Perpindicularity)"
.AddItem "TP (True Position)"
.AddItem "Con (concentricity)"
.AddItem "Sym (Symetry)"
.AddItem "CiRo (Circular Runout)"
.AddItem "ToRo (Total Runout)"
End With
End Sub
Private Sub OptionButton2_Click()
ListBox1.Height = "108.7" 'force list box height? (for testing)
MsgBox ListBox1.Height 'for testing
ListBox1.Clear
TextBox11.Font = "IMS"
SaveSetting "GdtFcfBuilder", "Variables", "sStdFont", OptionButton1.Value
SaveSetting "GdtFcfBuilder", "Variables", "sIMSFont", OptionButton2.Value
With ListBox1
.Font.Name = "IMS"
.Font.Size = "8"
.AddItem "³ (Straigtness)"
.AddItem "ä (Flatness)"
.AddItem "Î (Roundness)"
.AddItem "ü (Profile Line)"
.AddItem "æ (Profile Surface)"
.AddItem "² (Angularity)"
.AddItem "á (Parallelism)"
.AddItem "ã (Perpindicularity)"
.AddItem "û (True Position)"
.AddItem "â (concentricity)"
.AddItem "ÿ (Symetry)"
.AddItem "ç (Circular Runout)"
.AddItem "è (Total Runout)"
End With
End Sub
Edit 1:
I added code to force the height, but when togling you can actually see the height change.
Is this due to changing Fonts?
Edit 2:
I set the Integral height to False, this seems to maintain the height but I cant scroll to the bottom of my list when option button2 is true.
So I am back to square one. I removed the following code form both option buttons:
ListBox1.Height = "108.7" 'force list box height? (for testing)
MsgBox ListBox1.Height 'for testing
Thus the listbox shrinks.
Any hints, tips or examples are appreciated.
Bookmarks