[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

File --> ListBox (multiselect)

Posted on 1997-06-16
2
Medium Priority
?
372 Views
Last Modified: 2012-06-27
How can I multiselet files in  a FileListBox and have them added to a ListBox? Also, how can I write the ListBox to a file (all contents of). Any help would be highly credited. Thank you. --Mike
0
Comment
Question by:powermike
2 Comments
 
LVL 1

Accepted Solution

by:
mirkus earned 300 total points
ID: 1427368
For resolve your first problem follow this step:

1) Set Multiselct proprety in Filelist Control
2) You must chocie an event or an procedure that you'll use to catch files from FileListBox to ListBox (For example GotFocus on List Focus)

Private Sub FileList  GotFocus()
Dim i, Contatore As Integer
Dim File_selez() As String    'Matrix variable

Contatore = -1
List1.Clear

    For i = 0 To File.ListCount - 1
        If File.Selected(i) Then
            Contatore = Contatore + 1
            ReDim Preserve File_selez(Contatore)
            File_selez(Contatore) = File.List(i)
    End If

Next i
   
For i = 0 To UBound(File_selez)
        List1.AddItem File_selez(i)
Next i


Note: "File" is the Name of FileListBox Control
          "List1" is the Name of List Box Control

For your second problem I don't understand

                                             Mirkus.....
0
 

Author Comment

by:powermike
ID: 1427369
I meant, how do you save all entries in the ListBox, using the commondialog commands? --Mike
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question