为什么我在一个线程里使用openFileDialog对话框时,在我的电脑里不能看见盘符
而直接在主线程使用openFileDialog就没问题?应该怎么解决?? 代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void ShowOpenDialog()
{
OpenFileDialog op = new OpenFileDialog();
op.ShowDialog();
}
private void button1_Click(object sender, EventArgs e)
{
Thread t = new Thread(new ThreadStart(ShowOpenDialog));
t.Start(); }
}
}
解决方案 »
- c# 如何通过数据源绑定到新的数据成员?
- 用TCPclient,能否在连接过程中更改连接端口,该如何实现?
- 请问怎样通过命令提示符查.NET的完整版本号?
- 关于C#2.0中的泛性的一个问题
- 求助 API自动完成外部程序TREEVIEW的右键命令
- 大家谁手上有raw格式的图片啊
- C#winfrom excel导出报错:System.InvalidCastException: 接口 Microsoft.Office.Interop.Exc
- 如何在网页中提取出QQ号码?
- 怎么进行编译啊》急!!!!在线等~~
- DataGrid 中怎样获得超连接列传递到另一网页中的值 ?(用C#)
- SQLSERVER数据库通过CLR调用webservice出现在问题
- traceword6.sqlservertask.lwordtask不会实现接口成员怎么办
public void ShowOpenDialog()
{
if (this.InvokeRequired)
{
showdlalog sdg = new showdlalog(this.ShowOpenDialog);
this.Invoke(sdg);
return;
}
OpenFileDialog op = new OpenFileDialog();
op.ShowDialog();
}
op.ShowDialog(this);如果做的多了,就知道是什么了.
请加我的QQ群号码:35651007 注明CSDN即可