C#WFA列表中打开文件对话框

时间:2011-10-17 01:08:06

标签: c# file checkbox

所以,将我的openFileDialog与Windows Form Application一起使用 - 我有了它,所以当我点击一个按钮时,它允许我选择一个以下代码的文件。

    {
        openFileDialog1.InitialDirectory = "Desktop";
        openFileDialog1.Title = "Select Mod Folder";
        openFileDialog1.FileName = "";
        openFileDialog1.ShowDialog();
    }

然后我得到了我想要显示所选文件的列表,使用该程序的人可以选中他们想要的单个程序的框。

我不确定我应该把什么列入名单

        // checkedListBox1
        // 
        this.checkedListBox1.AllowDrop = true;
        this.checkedListBox1.CheckOnClick = true;
        this.checkedListBox1.FormattingEnabled = true;
        this.checkedListBox1.Location = new System.Drawing.Point(12, 40);
        this.checkedListBox1.Name = "checkedListBox1";
        this.checkedListBox1.ScrollAlwaysVisible = true;
        this.checkedListBox1.Size = new System.Drawing.Size(217, 304);
        this.checkedListBox1.TabIndex = 8;
        this.checkedListBox1.SelectedIndexChanged += new System.EventHandler(this.checkedListBox1_SelectedIndexChanged);
        // 

我正在使用 Microsoft Visual

1 个答案:

答案 0 :(得分:0)

列表是管道分隔的。

C#Files | c#| VB Files | .vb

您可以参考此信息以获取更多信息...... http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filter.aspx