CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    7

    VB6 CommonDialog - Open File problem

    Am confused...

    When I execute the following code ...
    Why do I see files in c:\Users\lee\documents folder when PIX filter selected?
    Why do I see files in all sorts of folders when PDFS filter selected?
    My .initDir property specifies root folder to search.


    Code:
    Private Sub Command1_Click()
        CommonDialog1.InitDir = "c:\trims2k"
        CommonDialog1.Filter = "PDFS|*.pdf|Pix|*.jpg"
        CommonDialog1.FilterIndex = 2
        CommonDialog1.Flags = cdlOFNNoChangeDir
        CommonDialog1.ShowOpen
        Text1.Text = CommonDialog1.FileName
    End Sub
    Files displayed when i click down arrow on file list are shown below..
    Any help is appreciated.

    Lee
    Attached Images Attached Images

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: VB6 CommonDialog - Open File problem

    I suppose you've already found an answer.. But for the benefit of the forum users I'll post a link here explaining how to achieve this:

    http://www.vb-helper.com/howto_add_c...g_filters.html

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

Featured