Skip to content

Instantly share code, notes, and snippets.

/Form1.cs Secret

Created May 1, 2017 17:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/6a32897c4a4dada6e76126b274b16254 to your computer and use it in GitHub Desktop.
// https://teratail.com/questions/74554
using System;
using System.Windows.Forms;
namespace _55216465214655421
{
public partial class Form1 : Form
{
private static System.Timers.Timer timer;
public Form1()
{
InitializeComponent();
var timer = new System.Timers.Timer();
timer.Elapsed += Timer_Elapsed;
timer.Interval = 1000;
timer.Start();
}
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
this.Invoke((MethodInvoker)delegate ()
{
textBox1.Text = Guid.NewGuid().ToString();
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment