Listbox height does not always change

Discussion in 'AutoCAD' started by AKS, Jul 26, 2004.

  1. AKS

    AKS Guest

    Hi, I've asked this question before with no answer. Now I'm trying
    again.

    The following is used to resize on the fly both a userform and a
    listbox within the userform. The idea is to avoid the listbox scroll
    control. This particular example does not bother to limit the form
    and listbox height. In AutoCAD VBA the technique works most of the
    time, but not all of the time. When it fails the userform is the
    correct new height but the listbox remains at its default height. The
    listbox always is sized correctly when stepping through the routine in
    debug mode. The function seems to always function correctly when
    following a file system operation. Repaints do not help.

    Sub SetDlgHeight()
    Dim L As Double
    With ufPickTarget
    L = Max(MinListDepth, .lbFilesOpen.ListCount * 10.2)
    .Height = L + .lbFilesOpen.top + 21
    .lbFilesOpen.Height = L
    End With
    End Sub

    Is there something I can do to force this to function every time?

    TIA, AKS
     
    AKS, Jul 26, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.