Results 1 to 4 of 4

Shrinking list box

Threaded View

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Shrinking list box


    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.
    Last edited by Rick_Stanich; 08-15-2009 at 11:37 AM.
    Regards

    Rick
    Win10, Office 365

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1