1
カウントダウンがあり、メインフォームのラベルに出力されます。メインフォームから子フォームにカウントダウンします他のすべてのウィンドウ(ゲーム用)私は子供のラベルのカウントダウンを更新することができません。私はポップアウトボタンを押すと、私は2番目になる。親ラベルからタイマーカウントダウンを取得
このメインフォーム上
private void tmrMain_Tick(object sender, EventArgs e)
{
TimerSeconds = TimerSeconds - 1;
if (TimerSeconds == 0)
{
tmrMain.Stop();
if (chbxPlaySound.Checked)
{
System.Media.SystemSounds.Exclamation.Play();
}
if (chbxRepeat.Checked)
{
btnStartTimer.PerformClick();
}
}
string dis_seconds = Convert.ToString(TimerSeconds);
//
// lblTimer is the label that shows the countdown seconds
//
lblTimer.Text = dis_seconds;
}
これは私のポップですアウトボタンメインフォーム上の
private void btnPopOut_Click(object sender, EventArgs e)
{
PopTimer ShowTimer = new PopTimer(TimerSeconds);
ShowTimer.Show(this);
}
これは私の子フォーム
public partial class PopTimer : Form
{
public PopTimer(int countTimer)
{
InitializeComponent();
//string dis_seconds = Convert.ToString(TimerSeconds);
lblPopTimer.Text = Convert.ToString(countTimer); ;
}
}
は今完璧な作品、ありがとう – Manvaril