All lines appearing at once

  • Thread starter Tolga Tanriverdi
  • Start date
T

Tolga Tanriverdi

I wrote a program and when i click the button i want the lines that i want
print in an order

my code is like this




public void btn_clicked(object ob, EventArgs e)
{
this.btn.Visible = false;
this.txt1.Text = "Waiting For Username and Password....\n\n";//this
//This line writes on my progrram and then wait until query complete
if (sorgu(this.text1.Text, this.text2.Text))
{
if (client())
{
if (sylcontrol())
{
if (uobasic())
{
if (proccescheck())
{
this.txt1.Text += "Ultima Online Calistiriliyor.// This
line is..\n"; //This line must be written after theese functions completed
uocfg();
}
else
{
txt1.Text += "Yasakli Bir Program Bulundu....\n";
this.Close();
}

}
else
{
txt1.Text += "Dosya Bulunamadi....\n";
this.Close();
}
}
else
{
txt1.Text += "Sunucu Baglantisinda Hata Olustu....\n";
this.Close();
}
}
else
{
txt1.Text += "Yama Guncellemede Hata Olustu....\n";
this.Close();
}
}
else
{
txt1.Text += "Kullanici Adi veya Sifre Hatali....\n";
this.Close();
}
}



but in my program it waits until everythin has done than all messages
appering at once
how can i fix that?
Thanks
 
J

Jon Skeet [C# MVP]

Dakkar said:
Sorry i didnt understand could you be more spesific

All your code is running in the UI thread. It shouldn't be - the UI
thread is there to do UI things, that's all.

Read the whole of the article I linked to before for much more detail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top