Lost the file list in openfiledialog window

OpenfileDialog does not show the list of files

Page 1 of 1

8 Replies - 1896 Views - Last Post: 29 December 2008 - 12:34 PM Rate Topic: -----

#1 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Lost the file list in openfiledialog window

Posted 29 December 2008 - 10:54 AM

When i added a 2nd openfiledialog i lost the file list in both dialogs
I deleted both file dialogs, added another openfiledialog and coded it the same as the first dialog was previously. now the openfiledialog and the savefiledialog does not show any file list. But when i start to type in the file name box a list of the files that are in the folder appear . if i click on one of them files and click open the image file will properly go into the picture box in the program. Here is the code for the open file dialog


 If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
			PBDisplay.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
			PBDisplay.Image = Image.FromFile(OpenFileDialog1.FileName)
			PBDisplay.Visible = True
		End If




this code is in the file filter on the properties of the open dialog


 All files (*.*) | *.* | JPEG files (*.jpg) | *.jpg |BMP files (*.bmp) | *.bmp | PNG files (*.png) |*.png| GIF files (*.gif) |*.gif




What is confusing to me is the code above worked fine before i added the second dialog and my code is now back to the same as it was before i added the second dialog. And i have the same problem no files show in the open file dialog form window.

Is This A Good Question/Topic? 0
  • +

Replies To: Lost the file list in openfiledialog window

#2 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 10:58 AM

Most likely that is not in any way connected to the code you are writing. It is just a system/IDE issue, so the first I would recommend is restarting the IDE and/or computer and see if it works. Also, try adding the same dialogs in a new project, and see if it works there.
Was This Post Helpful? 0
  • +
  • -

#3 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 11:11 AM

View PostCore, on 29 Dec, 2008 - 09:58 AM, said:

Most likely that is not in any way connected to the code you are writing. It is just a system/IDE issue, so the first I would recommend is restarting the IDE and/or computer and see if it works. Also, try adding the same dialogs in a new project, and see if it works there.

I restarted computer and same thing will try to add dialog to another project
Was This Post Helpful? 0
  • +
  • -

#4 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 11:23 AM

View PostGerLeb93, on 29 Dec, 2008 - 10:11 AM, said:

View PostCore, on 29 Dec, 2008 - 09:58 AM, said:

Most likely that is not in any way connected to the code you are writing. It is just a system/IDE issue, so the first I would recommend is restarting the IDE and/or computer and see if it works. Also, try adding the same dialogs in a new project, and see if it works there.

I restarted computer and same thing will try to add dialog to another project

The openfiledialog works properly on another project
Was This Post Helpful? 0
  • +
  • -

#5 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 11:34 AM

Then try copying the existed code to the new project. For the old project, try launching the application executable (located in the bin sub-folder in the project folder) and see if the dialogs show correctly. This will give you a clue, whether the issue is caused by the IDE or something else.

This post has been edited by Core: 29 December 2008 - 11:35 AM

Was This Post Helpful? 0
  • +
  • -

#6 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 11:43 AM

View PostCore, on 29 Dec, 2008 - 10:34 AM, said:

Then try copying the existed code to the new project. For the old project, try launching the application executable (located in the bin sub-folder in the project folder) and see if the dialogs show correctly. This will give you a clue, whether the issue is caused by the IDE or something else.


will try that thanks
Was This Post Helpful? 0
  • +
  • -

#7 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 11:53 AM

View PostGerLeb93, on 29 Dec, 2008 - 10:43 AM, said:

View PostCore, on 29 Dec, 2008 - 10:34 AM, said:

Then try copying the existed code to the new project. For the old project, try launching the application executable (located in the bin sub-folder in the project folder) and see if the dialogs show correctly. This will give you a clue, whether the issue is caused by the IDE or something else.


will try that thanks


Tried both opened project from bin and pasted code to a new project and same results no files show in dialog
Was This Post Helpful? 0
  • +
  • -

#8 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 12:11 PM

If the problem is that no files are shown for a specific file filter, then the problem source is the filter string. Your filter string should look like this:

All Files (*.*) |*.*|JPEG files (*.jpg)|*.jpg|BMP files (*.bmp)|*.bmp| PNG files (*.png)|*.png|GIF files (*.gif)|*.gif



You sohuld not have extra spaces while declaring the file format. So, when declaring a filter, you should write your stament like this:

All Files|*.*



Not like this"

All Files| *.* |JPEG Files| *.jpg


Was This Post Helpful? 0
  • +
  • -

#9 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Re: Lost the file list in openfiledialog window

Posted 29 December 2008 - 12:34 PM

View PostCore, on 29 Dec, 2008 - 11:11 AM, said:

If the problem is that no files are shown for a specific file filter, then the problem source is the filter string. Your filter string should look like this:

All Files (*.*) |*.*|JPEG files (*.jpg)|*.jpg|BMP files (*.bmp)|*.bmp| PNG files (*.png)|*.png|GIF files (*.gif)|*.gif



You sohuld not have extra spaces while declaring the file format. So, when declaring a filter, you should write your stament like this:

All Files|*.*



Not like this"

All Files| *.* |JPEG Files| *.jpg


Thank you so much works fine now
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1