VBA List Box versus VB6 List Box??

Discussion in 'AutoCAD' started by pkirill, Apr 20, 2004.

  1. pkirill

    pkirill Guest

    I had a great little program all worked out in VB6. Then when I tried to
    port it into VBA I found that VBA doesn't support checkbox style list boxes
    (??). So I began rewriting and have this question:

    Why is it that the code below will work on a VBA list box designated as
    frmMultiSelectSingle but not when designated as frmMultiSelectMulti or

    All I want is for a drawing preview and some summary information to show in
    my form as I select list items....

    Thanks for any help... I'm very confused...


    Option Explicit
    Option Compare Text
    Public strPath As String
    Public sFileName As String

    Private Sub cmdCancel_click()
    Unload formLegendBuilder
    End Sub

    Private Sub List1_Click()
    If TabStrip1.SelectedItem.Caption = "DUCT" Then
    strPath = "G:\CAD Standards\HCYU Standards\Research & Development\HVAC
    sFileName = strPath & List1.Text & ".dwg"
    End If
    End Sub

    'Private Sub TabStrip1_Click()
    'MsgBox TabStrip1.SelectedItem.Caption
    'End Sub

    Private Sub UserForm_initialize()

    Dim objFSO As Scripting.FileSystemObject
    Dim objFolder As Scripting.Folder
    Dim objFile As Scripting.File

    frmColumnTtl.Caption = "Number of Columns: " & sldColumns.Value

    Set objFSO = New Scripting.FileSystemObject
    Set objFolder = objFSO.GetFolder("G:\CAD Standards\HCYU Standards\Research &
    Development\HVAC Legend\PSSL\")
    For Each objFile In objFolder.Files
    If objFile.Name Like "*.dwg" = True Then
    List1.AddItem Mid(objFile.Name, 1, (Len(objFile.Name) - 4))
    Dim i As Scripting.File
    End If
    Next objFile

    End Sub

    Public Sub InfoDisplay()
    Dim oThumb As DwgThumbnail

    Dim dwgProps As DWGPROPSXLib.Properties
    Set dwgProps = New DWGPROPSXLib.Properties
    dwgProps.Load sFileName
    If Len(dwgProps.Title) > 0 Then
    lblLegendText.Caption = (UCase(dwgProps.Title))
    lblLegendText.Caption = "N\A"
    End If

    If Len(dwgProps.Comments) > 0 Then
    lblBlkDescription.Caption = (dwgProps.Comments)
    lblBlkDescription.Caption = "No drawing summary data available."
    End If

    DwgThumbnail1.DwgFileName = sFileName
    End Sub
    pkirill, Apr 20, 2004
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.