How to create a file selection dialog Archived to Disk
I am trying to create a form where I can allow the user to select the file that they would like to import. The problem is that I am unable to find anywhere that can tell me how to create the dialog I need to allow the user to select the file. Please help. I need this ASAP. Thanks
15-05-2002 at 03:26 PM
|
JLRodgers Level: Moderator Registered: 04-04-2002 Posts: 1616
Re: How to create a file selection dialog Archived to Disk
Common Dialog Control.
15-05-2002 at 03:55 PM
|
indycat12 Level: Guest
Re: How to create a file selection dialog Archived to Disk
I am sorry but I need a little more description then that please. I am fairly new to this and need a little more info to be able to follow what you mean.
Thanks
15-05-2002 at 05:32 PM
|
godspeed Level: Guest
Re: How to create a file selection dialog Archived to Disk
Ok, first of all you have to add the component to the tool bar. You do this by right clicking it and selecting components. than you find the component called microsoft common dialog control. Now check it and click ok. Create on of these controls on the form, I hope you would know how to do this. lets say you want to open a text file to a textbox buy clicking command1. i have to go I will post the code later....
15-05-2002 at 05:36 PM
|
JLRodgers Level: Moderator Registered: 04-04-2002 Posts: 1616
Re: How to create a file selection dialog Archived to Disk
Additional info on the control itself as basic usage:
Private Sub Form_Load()
' The most common things you'll need
' For other options consult the help file (MSDN library)
' This shows how to show the "open file" dialog, and what the two common properties that you'll use (filename/title)
With CommonDialog1
.Filter = "Text (*.txt)|*.txt|Pictures (*.bmp;*.ico)|*.bmp;*.ico"
.DialogTitle = "This is the title"
.DefaultExt = "*.txt"
.InitDir = App.Path ' Initial Directory
.ShowOpen
MsgBox .FileName
MsgBox .FileTitle
End With
End Sub
15-05-2002 at 05:47 PM
|
indycat12 Level: Guest
Re: How to create a file selection dialog Archived to Disk
My company is having a hard time finding how to licensce the common dialog control. Does anyone have any ideas?
28-05-2002 at 07:16 PM
|
JLRodgers Level: Moderator Registered: 04-04-2002 Posts: 1616
Re: How to create a file selection dialog Archived to Disk
I always thought it was included with the OS itself, and unlike other controls (like the picture control), the MSDN library doesn't have any info on what licenses would be needed to include it (picture control uses non-Microsoft "stuff").
Point is, whenever an license is needed, the MSDN library normally has it listed.
[Edited by JLRodgers on 29-05-2002 at 10:53 AM GMT]
28-05-2002 at 09:41 PM
|
king910 Level: Guest
Re: How to create a file selection dialog Archived to Disk
quote:indycat12 wrote:
I am trying to create a form where I can allow the user to select the file that they would like to import. The problem is that I am unable to find anywhere that can tell me how to create the dialog I need to allow the user to select the file. Please help. I need this ASAP. Thanks
Use the DIR() function, then add a loop to show all the files in a listbox, change the property(Multiselect) of the listbox to True. Add a command button to import the files selected. This will solve your problem.
If you want me elaborate on the above then let me know.