だから私はworkerthreadなどを実行するこのコードを持っています。必要な部分だけを表示するように短縮しました。UploaderDoWorkに、toolStripStatusLabel1に含めるテキストがあります。そこからtoolStripStatusLabel1に値を割り当てるにはどうすればよいですか?
using Google.GData.Client;
using Google.GData.Extensions.MediaRss;
using Google.GData.Extensions;
using Google.GData.YouTube;
using Google.YouTube;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using System.Windows;
using System;
using System.Globalization;
using System.Resources;
using System.Reflection;
using System.ComponentModel;
namespace Something
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private static BackgroundWorker uploader;
static void UploaderDoWork(object sender, DoWorkEventArgs e)
{
//How do I assign a value to toolStripStatusLabel1, that is in Form1 from here?
}
private void w()
{
uploader = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true };
uploader.DoWork += UploaderDoWork;
uploader.RunWorkerCompleted += delegate { System.Windows.Forms.MessageBox.Show(ursache + " beendet!"); };
uploader.RunWorkerAsync();
}
private void button1_Click(object sender, EventArgs e)
{
w();
}
}
}