Prosiłbym o pomoc ponieważ nie mam już siły z tym walczyć... masakra jakaś...
private void button1_Click(object sender, System.EventArgs e)
{
Thread trd = new Thread(new ThreadStart(this.load_Costam));
trd.IsBackground = true;
trd.Start();
}
...
...
...
private void load_Costam()
{
try
{
OpenFileDialog open = new OpenFileDialog();
..........
..........
..........
..........
if (open.ShowDialog() == DialogResult.OK)
{
}
}
catch (Exception e)
{
Console.Write("" + e.Message);
}
}
Niewiem jak obejść to żeby nie pojawiał się ten bląd...
the Current thread must be set to single thread apartment (STA) mode before
OLE calls can be made. Ensure that your Main function has STAThreadAttribute
marked on it. This exception is only raised if a debugger is attached to the
process
oczywiście przed main jest [MTAThread] czy jakoś tak..