From 5db51dda99749af0392fdf7ccdb2a2bfc1fe55ca Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Tue, 24 Jun 2025 10:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=99=E7=B1=A4=E5=88=B7=E6=96=B0=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OverlayFormObj/OverlayForm.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OverlayFormObj/OverlayForm.cs b/OverlayFormObj/OverlayForm.cs index d0c7dd3..11a84b4 100644 --- a/OverlayFormObj/OverlayForm.cs +++ b/OverlayFormObj/OverlayForm.cs @@ -450,13 +450,13 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e) // 如果目前不在 UI 執行緒上,必須透過 Invoke 安全執行 UI 更新邏輯 Console.WriteLine("SongDisplayTimer_Tick invoked on UI thread."); - MainForm.Invoke(new System.Action(() => + MainForm.BeginInvoke(new Action(() => { - // 清除目前歌曲的顯示標籤文字 - MainForm.songDisplayLabel.Text = ""; + if (MainForm.songDisplayLabel != null) + MainForm.songDisplayLabel.Text = ""; - // 顯示下一首歌的標籤 - MainForm.nextSongLabel.Visible = true; + if (MainForm.nextSongLabel != null) + MainForm.nextSongLabel.Visible = true; })); } else