Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting Multiple File
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00272857
Message ID:
00273400
Views:
17
>>>>>I've been trying to write a form that will allow a user to select multiple datafiles and store them in an array. I'm using a listbox to display the selected files and I have an add button that uses getfile() and AINS to insert the selected file into the array. AINS is working, but after I refresh the control or the entire form, the listbox only displays the number of elements that the form started with. The array is updated and if I quit the form then come back all of the elements are there. Initially I had the numberofelements set to =alen(ArrayName), that did not work, so I tried hard coding it to 30 and that did not work. Any ideas?
>>>>
>>>>
>>>>I think you are missing the requery method. After inserting into the array then call:
>>>> ThisForm.lstMyListBox.Requery
>>>>Then do the refresh. I missed that the first time I worked with the listbox too.
>>>
>>>Thanks! That worked!
>>
>>Hi Marvin,
>>
>>Just a suggestion. Rather than GETFILE(), I'd use the Common Dialogs ActiveX control's ShowOpen method. The flags property of this control will allow the user to select multiple files in the same directory with a single call.
>
>Good idea? Which OCX is the ShowOpen method located in? I could not find it.
>
>Thanks! Marvin

It's in the Comdlg32.ocx (I think). Just drop the control on your form, right click it and select help from the context menu. There are a number of different dialogs you can call (Color selection, printer, etc.). It's one of the older ActiveX controls, and it's very stable. About the only problems I've had are versioning ones, so as a result I've come to subclass just about all the ActiveX controls I use (because versioning is a common problem and subclassing overcomes this).
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform