ComboBox Overpopulates

Discussion in 'AutoCAD' started by stck2mlon, May 7, 2004.

  1. stck2mlon

    stck2mlon Guest

    Each time I pull down on this list, it adds more layouts to the list. I don't want to use an initialize form event, can I do something right in the code to make it only list the layouts and not add with each susequent pull-down?

    Private Sub cmbLayout_DropButtonClick()
    Dim acLayout As AcadLayout
    For Each acLayout In ThisDrawing.Layouts
    cmbLayout.AddItem acLayout.Name
    Next
    End Sub
     
    stck2mlon, May 7, 2004
    #1
  2. stck2mlon

    bcoward Guest

    Stck2mlon,

    Maybe I'm trying to see too many trees in the forest. Are you asking to clear your combo box each round before it is populated again via AddItems?

    If then Do...

    cmbLayout.Clear
    For Each acLayout in ThisDrawing.layouts
    cmbLayout.AddItem acLayout.Name
    Next

    Hope this answers your question.

    Regards,

    Bob Coward
    CADS, Inc

    800-366-0946
     
    bcoward, May 7, 2004
    #2
  3. stck2mlon

    stck2mlon Guest

    That was perfect, thank you very much!
     
    stck2mlon, May 7, 2004
    #3
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.