Results 1 to 4 of 4

Thread: multi select dialog box

  1. #1
    Member
    Join Date
    2004-12
    Posts
    42
    Login to Give a bone
    0

    Default multi select dialog box

    I would like to be able to multiselct in a dialog box
    not sure of the setting for this

    Code:
    ' setup info for browse button
    Sub getdefaultfile()
        CommonDialog1.Filter = "all files (*.dwg) |*.dwg|"
        '    & "Pdf FIles (*.pdf) |*.pdf|"
        '    & "Pdf FIles (*.dwg) |*.dwg|"
        CommonDialog1.FilterIndex = 2
        CommonDialog1.DialogTitle = "Select File"
        CommonDialog1.InitDir = mssearchpath
        CommonDialog1.ShowOpen
        newfilename = CommonDialog1.FileTitle
        lsttomove.AddItem CommonDialog1.FileTitle
        
        
    End Sub
    [ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]
    Last edited by Opie; 2006-03-10 at 02:59 PM. Reason: [CODE] tags added

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: multi select dialog box

    I would abandon the CommonDialog control, especially if you're using vba, since the vb license doesn't allow for use in vba. Instead, use the windows api. Here is a class that wraps some file api's. I got ifrom Randall Rath, but I added the functionality for multiselect options.
    Attached Files Attached Files
    C:> ED WORKING....

  3. #3
    Member
    Join Date
    2004-12
    Posts
    42
    Login to Give a bone
    0

    Default Re: multi select dialog box

    Thank you for the info works great

    But I do have another question

    When I was using the common dialog control I would use
    newfilename = CommonDialog1.FileTitle

    with newfilename being what was selected

    guess i am not sure what to use to get what i have selected in the dialog box

    thanks again

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: multi select dialog box

    Here's a sample of how you might use the class.

    Code:
    Public Sub OpenFile()
        'sample to show how to use FileDialogs
        Dim objFile As FileDialogs
        Dim strFilter As String
        Dim strFileName As String
        
        Set objFile = New FileDialogs
        'desc,filter combinations must all be separated with pipe char "|"
        strFilter = "All Files (*.*)|*.*|Drawings (*.dwg)|*.dwg"
        objFile.OwnerHwnd = ThisDrawing.hWnd    'bind the dialog to the window
        objFile.Title = "Open a drawing"
        'default dir is CurDir
        objFile.StartInDir = "c:\"
        objFile.Filter = strFilter
        'return a valid filename
        strFileName = objFile.ShowOpen
        If Not strFileName = vbNullString Then
            'use this space to perform operation
            MsgBox strFileName
        End If
        Set objFile = Nothing
        
        
    End Sub
    C:> ED WORKING....

Similar Threads

  1. Replies: 6
    Last Post: 2015-11-09, 06:38 PM
  2. File Multi Selection Dialog (and Folder Select)
    By peter in forum Bridging the Gap: LISP -> .NET -> LISP
    Replies: 1
    Last Post: 2014-02-18, 04:46 PM
  3. Multi select Bolted Connection
    By Wish List System in forum Inventor Wish List
    Replies: 0
    Last Post: 2013-09-27, 06:52 AM
  4. Multi Select Tab
    By awarren in forum AutoCAD General
    Replies: 0
    Last Post: 2009-08-28, 01:49 PM
  5. Select File dialog box default
    By gabem in forum AutoCAD General
    Replies: 11
    Last Post: 2005-04-29, 05:04 PM

Posting Permissions

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