Hello,
The following has a Timer and a button in a standard windows form project. Click the button to toggle visible and in this example Visible is reported correctly.
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Shown += OnShown;
}
private bool _loaded;
private void OnShown(object sender, EventArgs e)
{
_loaded = true;
}
private void Form1_VisibleChanged(object sender, EventArgs e)
{
if (_loaded)
{
Debug.WriteLine($"{Visible}");
}
}
private async void button1_Click(object sender, EventArgs e)
{
Visible = !Visible;
await Task.Delay(2000);
Visible = !Visible;
}
}
}