how to make infinite loop in c#
for (int a = 0; a < 50; a--)
{
// Whatever You Want To Do.
}
how to make infinite loop in c#
for (int a = 0; a < 50; a--)
{
// Whatever You Want To Do.
}
how to make an infinite loop in c# without breaking the UI
public partial class MainWindow : Window
{
private readonly System.Timers.Timer _timer;
public MainWindow()
{
InitializeComponent();
_timer = new Timer(250); //Updates every quarter second.
_timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
}
private void OnTimedEvent(object source, ElapsedEventArgs e)
{
ProcessGeneration();
}
private void PlayClick_Handler(object sender, RoutedEventArgs e)
{
var enabled = _timer.Enabled;
if(enabled)
{
PlayButton.Content = "Play";
_timer.Enabled = false;
}
else
{
PlayButton.Content = "Pause";
_timer.Enabled = true;
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us