|
-
Dec 7th, 2002, 09:36 PM
#1
Thread Starter
Member
File Filter Dilemma - *Resolved*
Hey guys, I have a small problem. I want to show the Open DialogBox, but have the default file filter be set to "All Image Files", and have it showing files of the type bmp, jpg, jpeg, and gif.
I have the following code, but it doesn't work. It displays the correct text ("All Image Files (*.bmp), (*.jpg), (*.jpeg), (*.gif)" in the drop-down on the dialogbox, however, creates several blank text entry's below it, each which are one of the filters.
How can I have it so that the default filter is All Image Files, and show the types of files listed above?
VB Code:
Dim sFileFilter As String
sFileFilter = "All Image Files (*.bmp), (*.jpg), (*.jpeg), (*.gif)|*.bmp| |*.jpg| |*.jpeg| |*.gif|"
With CommonDialog2
.Filter = sFileFilter
' Some other flags and such are here
.ShowOpen
' Some other code related to my program is here
End With
Last edited by NeedHelpPlz; Dec 7th, 2002 at 09:55 PM.
-
Dec 7th, 2002, 09:49 PM
#2
To filter more than one extension at a time, separate the extensions with a semicolon
VB Code:
CommonDialog1.Filter = "All Graphics|*.bmp;*.jpg;*.gif"
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 7th, 2002, 09:55 PM
#3
Thread Starter
Member
Thank-you Sir, learned something new!
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
|