|
-
Dec 27th, 2001, 10:54 PM
#1
Using filters in Common Dialog boxes
I want the user only see the files with .edl extension only when browsing.
I have set the properties for defaultext and filter to *.edl but it still shows everything. (*.edl shows up in the CommonDialog box in the Files of Type window.... but that's it)
Can someone help?
Thanks,
Eric
-
Dec 27th, 2001, 11:01 PM
#2
Addicted Member
Hi nottheboss,
Try this out:
Me.CommonDialog1.Filter = "EDL (*.edl)|*.edl"
Me.CommonDialog1.ShowOpen
Hope it helps
Keiko
-
Dec 27th, 2001, 11:09 PM
#3
Where in my code do I Put that? I tried it in a couple of places and it seems to have no effect.
BTW, it is CommonDialog1 so that's not the problem.
Does my filterindex property have anything to do with it?
-
Dec 27th, 2001, 11:12 PM
#4
Addicted Member
Hi nottheboss,
You should place it in the procedure that fires the Dialog Box.
e.g:
Private Sub cmdOpenDialog_Click()
Me.CommonDialog1.Filter = "EDL (*.edl)|*.edl"
Me.CommonDialog1.ShowOpen
End Sub
Hope it helps
Keiko
-
Dec 27th, 2001, 11:16 PM
#5
Got it. Great. Works like a charm.
Thanks Keiko!!!
-
Dec 27th, 2001, 11:16 PM
#6
You can also set the Filter property at design-time.
But you have to follow the syntax:
Code:
Text to show|Filter1|Other text|Filter2
EDL files|*.edl|All Files|*.*
Best regards
-
Dec 27th, 2001, 11:18 PM
#7
Member
Also, you can use the FilterIndex property (set it to 0) to select the first filter by default. Also it is good practice as Joacim showed to always include the option to select any type of file.
Last edited by filburt1; Dec 27th, 2001 at 11:24 PM.
-
Dec 27th, 2001, 11:23 PM
#8
Thanks for the added tips.
The All Files is an important one and something I overlooked.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|