Note that there are some explanatory texts on larger screens.

plurals
  1. POExecuting Thread while dynamically updating UI
    primarykey
    data
    text
    <p>I've been having the worst time trying to figure this out. I'm quite confused when it comes to threading. </p> <p>What I'm trying to do is have a delay of 1 pause in the function and the continue the function until another 1 sec pause comes along and finally finish the function.</p> <pre><code>public partial class SplashScreen : Form { public SplashScreen() { InitializeComponent(); // initalize splash screen DatabaseStatus(); // set database connection getUserInfo(); // get user information showInfo(); // show app information on splash screen System.Threading.Thread wa = new System.Threading.Thread(new System.Threading.ThreadStart(checkUser)); wa.IsBackground = true; wa.Start(); } void checkUser() { if (RegisteredUser) { richTextBox1.Text += "Loading user settings..."; // SHOW THIS TEXT AND WAIT 1 SECOND UNTIL NEXT System.Threading.Thread.Sleep(1000); if (DATABASE_CONNECTION) { richTextBox1.Text += "Loging on..."; // WAIT AGAIN 1 SEC AND CONTINUE/// LoginCheck login = new LoginCheck(USER_NAME, PASSWORD); if (login.LOGIN_SUCESS) { richTextBox1.Text += "Sucess!"; // SHOW THIS TEXT AND WAIT 1 SEC UNTIL SPLASH SCREEN FADE OUT// //MessageBox.Show(login.HASH); opac.Interval = 12; opac.Start(); opac.Tick += new EventHandler(dec); } else { MessageBox.Show(login.HASH); } } } else { richTextBox1.Text += "Not user profile found..."; // ask user to register } } } </code></pre> <p>Where I've placed the comments is where I want the thread to pause and continue...</p> <p>Anyone have any input?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload