I am new to C # you couldn’t help me fix the code. That the action would be repeated every second. Ie got out the message box every second.
void StartTimer() { int timeout = 0; while (true) { timeout = (1 - DateTime.Now.Second) * 1 - DateTime.Now.Millisecond; Thread.Sleep(timeout); MessageBox.Show("Nen"); } }
MessageBox.Show("...")
stops the current execution of the code (current thread) until the user closes it. Therefore, your code will not work. To implement your plans, you need to use multithreading or a timer that does it for you. Therefore, I advise you to postpone your plans until you get to these topics. - Alex Krass