CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #4
    Join Date
    Jul 2009
    Location
    Kuwait
    Posts
    170

    Re: browse path copying to textbox

    thanks for the help. I was looking for the openfiledialog only.
    While setting the filter here, i am facing a problem. I want to select only image files. So i wrote like this
    Code:
    openFileDialog1.Filter = "image (*.jpg) |*.bmp;*.gif|All files (*.*)|*.*"
    but this is not showing the files with jpg extension, and i have to select All files option to view that. Where am i doing it wrong?
    this is the complete code
    Code:
     Dim openFileDialog1 As System.Windows.Forms.OpenFileDialog
    
            openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            openFileDialog1.InitialDirectory = "D:\"
    
            ' openFileDialog1.Filter = "image (*.jpg) |*.bmp;*.rtf|(*.txt) |*.txt|(*.*) |*.*"
            'openFileDialog1.Filter = " (*.jpg) |*.bmp;*.rtf|(*.txt) |*.txt|(*.*) |*.*"
            openFileDialog1.Filter = "*.jpg|*.jpg |All files (*.*)|*.*"
            If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                locpic.Text = openFileDialog1.FileName
            End If
    Last edited by makdu; August 27th, 2009 at 04:55 AM.

Tags for this Thread

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