allgemeine teilweise Kategorie Form1: Form
{
privates System.ComponentModel.BackgroundWorker bgw = Null;
privates Class1 myObject1 = neues Class1 ();
Öffentlichkeit Form1 ()
{
InitializeComponent ();
}
private Lücke textBox1_KeyPress (Gegenstandabsender, KeyPressEventArgs e)
{
wenn (bgw == Null)
{
bgw = neues BackgroundWorker ();
bgw.DoWork += neues DoWorkEventHandler (bgw_DoWork);
bgw.RunWorkerCompleted += neues RunWorkerCompletedEventHandler (bgw_RunWorkerCompleted);
}
wenn (e.KeyChar == 13 &&! bgw.IsBusy)
{
textBox1.Enabled = falsch;
myObject1.myString = textBox1.Text;
bgw.RunWorkerAsync ();
}
}
leeres bgw_DoWork (Gegenstandabsender, DoWorkEventArgs e)
{
myObject1.queryRecent ();
}
Lücke bgw_RunWorkerCompleted (Gegenstandabsender, RunWorkerCompletedEventArgs e)
{
label1.Text = myObject1.recentString;
textBox1.Enabled = richten aus;
}
}
|