Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: Compare decimals Pin
Roger Wright6-Jun-11 20:06
professionalRoger Wright6-Jun-11 20:06 
Question.NET Remoting DHCP Problem Pin
Member 24160216-Jun-11 6:05
Member 24160216-Jun-11 6:05 
AnswerRe: .NET Remoting DHCP Problem Pin
Dave Kreskowiak6-Jun-11 6:10
mveDave Kreskowiak6-Jun-11 6:10 
AnswerRe: .NET Remoting DHCP Problem Pin
jschell6-Jun-11 9:13
jschell6-Jun-11 9:13 
GeneralRe: .NET Remoting DHCP Problem Pin
Member 24160216-Jun-11 23:11
Member 24160216-Jun-11 23:11 
GeneralRe: .NET Remoting DHCP Problem Pin
BobJanova7-Jun-11 0:28
BobJanova7-Jun-11 0:28 
GeneralRe: .NET Remoting DHCP Problem Pin
jschell7-Jun-11 9:58
jschell7-Jun-11 9:58 
QuestionOpenFileDialog: Files of Type doesn't respond [modified] Pin
Danzy836-Jun-11 3:38
Danzy836-Jun-11 3:38 
Hello all, I am now learning to program in C#. I initialised an object of OpenFileDialog and set the filter. When the dialog box opens for the first time, everything seems to be OK. Files of the type specified in the filter a shown. But when I change Files of Type to All files which I have set with *.*, the list of files shown is not automatically updated as is expected. I don't know what is wrong. The following is the code I have.

using System;
using System.Drawing;
using System.Windows.Forms;


class MyForm : Form
{
    public static void Main()
    {
        Application.Run(new MyForm());
    }

    public MyForm()
    {
        Text = "My Form";

        Menu = new MainMenu();
        Menu.MenuItems.Add("&File");
        Menu.MenuItems[0].MenuItems.Add("&Open...", new EventHandler(FileOpenOnClick);
    }

    void FileOpenOnClick(object obj, EventArgs ea)
    {
       OpenFileDialog fodlg = new OpenFileDialog();
       
       fodlg.Filter = "Text Documents (*.txt)|*.txt|All Files (*.*)|*.*";

       if (fodlg.ShowDialog() == DialogResult.OK)
       {
           // some code here
       }

       // some code here
    }
}


I am using Visual Studio 2005 with .Net Framework 2.0. From the code above, I have only set the Filter property. When the file open dialog box opens first with Text documents, it works fine but when I change the Files of Type from the combobox to All Files, the dialog box is not updated to show all files. What could be wrong? What am I missing? Please help.

modified on Monday, June 6, 2011 10:01 AM

AnswerRe: OpenFileDialog: Files of Type doesn't respond Pin
Dave Kreskowiak6-Jun-11 3:45
mveDave Kreskowiak6-Jun-11 3:45 
AnswerRe: OpenFileDialog: Files of Type doesn't respond Pin
Eddy Vluggen6-Jun-11 3:47
professionalEddy Vluggen6-Jun-11 3:47 
AnswerRe: OpenFileDialog: Files of Type doesn't respond Pin
Mario Majčica6-Jun-11 3:48
professionalMario Majčica6-Jun-11 3:48 
QuestionAdvanced Debugging Techiniques Pin
AmbiguousName6-Jun-11 1:47
AmbiguousName6-Jun-11 1:47 
JokeRe: Advanced Debugging Techiniques Pin
BobJanova6-Jun-11 3:00
BobJanova6-Jun-11 3:00 
GeneralRe: Advanced Debugging Techiniques Pin
Trollslayer6-Jun-11 12:54
mentorTrollslayer6-Jun-11 12:54 
GeneralRe: Advanced Debugging Techiniques Pin
BobJanova7-Jun-11 0:25
BobJanova7-Jun-11 0:25 
AnswerRe: Advanced Debugging Techiniques Pin
Richard MacCutchan6-Jun-11 3:36
mveRichard MacCutchan6-Jun-11 3:36 
AnswerRe: Advanced Debugging Techiniques Pin
Shameel6-Jun-11 5:23
professionalShameel6-Jun-11 5:23 
GeneralRe: Advanced Debugging Techiniques Pin
GenJerDan6-Jun-11 6:34
GenJerDan6-Jun-11 6:34 
JokeRe: Advanced Debugging Techiniques Pin
MicroVirus6-Jun-11 12:38
MicroVirus6-Jun-11 12:38 
AnswerRe: Advanced Debugging Techiniques Pin
Abhinav S6-Jun-11 6:48
Abhinav S6-Jun-11 6:48 
AnswerRe: Advanced Debugging Techiniques Pin
AspDotNetDev6-Jun-11 10:11
protectorAspDotNetDev6-Jun-11 10:11 
QuestionWriting Regular Expression for local folder, shared folder and ftp path Pin
devvvy5-Jun-11 20:06
devvvy5-Jun-11 20:06 
AnswerRe: Writing Regular Expression for local folder, shared folder and ftp path [modified] Pin
BobJanova6-Jun-11 0:37
BobJanova6-Jun-11 0:37 
AnswerRe: Writing Regular Expression for local folder, shared folder and ftp path Pin
Pete O'Hanlon6-Jun-11 1:08
mvePete O'Hanlon6-Jun-11 1:08 
QuestionHello Friends Help Needed for My Project [Automatic Login System] Pin
hackerzpark4-Jun-11 17:10
hackerzpark4-Jun-11 17:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.