this.hora.Text = DateTime.Now.ToShortTimeString();
this.data.Text = DateTime.Now.ToShortDateString();
But you are not updating by yourself, I tried to get the mouse movement and the key pressed, but you can not call the functions that execute this all the time ..
I do not know, I have no idea how to do this, I had only seen C # in Unity and there was the ready function Update
that did this role (kept updating itself and executing the commands inside it), but how do I do this in Visual ?
I'm calling it like this:
public Interface()
{
InitializeComponent();
KeyPress += _keyPress;
MouseMove += _mouseMove;
}
public void _mouseMove(object sender, MouseEventArgs e)
{
this.mouseLocation = e.Location;
this.hora.Text = DateTime.Now.ToShortTimeString();
this.data.Text = DateTime.Now.ToShortDateString();
}
public void _keyPress(object sender, KeyPressEventArgs e)
{
this.hora.Text = DateTime.Now.ToShortTimeString();
this.data.Text = DateTime.Now.ToShortDateString();
}