Results 1 to 8 of 8

Thread: Common Dialog Filtering

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Scotland, UK
    Posts
    321

    Question Common Dialog Filtering

    Hi, I have a problem, When using the commondialog to load files, you can set a filter eg:

    Code:
                .Filter = "All Supported Formats (All Supported)|*.htm"
    How do I do a filter on multiple extensions at once, and also, how do I add multiple choices to the filter?

    Thanks for any help you can offer.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I don't know about multiple extensions at once, but for multiple filters, just keep using the pipe as a separator :
    Code:
    .Filter = "All Supported Formats (All Supported)|*.htm|All Files|*.*"
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Scotland, UK
    Posts
    321
    Thanks,

    Thier is a way to do it for multiple types at once though right?

  4. #4
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    To do multiple exentions
    VB Code:
    1. .Filter = "All Supported Formats (All Supported)|*.htm, *.asp,*.jsp,*.aspx|All Files|*.*"

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Scotland, UK
    Posts
    321
    Originally posted by moinkhan
    To do multiple exentions
    VB Code:
    1. .Filter = "All Supported Formats (All Supported)|*.htm, *.asp,*.jsp,*.aspx|All Files|*.*"
    Thank you, I tried commas, but never occured to me it may need spaces as well. THanks

  6. #6
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    man, what pills have you all been taking, that doesnt work 4 me

    Code:
    .Filter = "All Supported Formats (All Supported)|*.htm;*.asp;*.jsp;*.aspx|"
    That's the stylez
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

  7. #7
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    VB Code:
    1. CommonDialog1.Filter = "All Files|*.*|Picture Fiels|*.jpg;*.gif;*.bmp"

    What error r u getting?

  8. #8
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    No errors there

    I'm not getting any errors from that code, but from your previous post, you have used comma's (,) instead of semicolons ( and that wasn't working.
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width