0
は、「作品」が、それはとても素敵見ていない解決策を見つけました。これを解決する別の "クリーナー"の方法はありますか? は、ここに私のコードです:コード内のイベントのコメント。同じ仕事をしていませんのC#、私は最上位レベルの問題を抱えている問題は最上位と
OrderTemplateView template;
private void toolStripButton4_Click(object sender, EventArgs e)
{
if (template != null)
{
template.Close(); //must close to trigger close event.
template.Dispose();
}
mainUi.TopMost = true; // must set my mainUi topMost here othervise it drops in the background of other windows open at the computer.
template = new OrderTemplateView(this);
template.TopMost = true;// must set my dialog topmost othervise it drops behind my mainUi
template.StartPosition = FormStartPosition.CenterParent;
mainUi.TopMost = false;//must release my topmost so other windows on the computer can be called to front.
template.TopMost = false;
template.ShowDialog();
}
更新コード:
private void toolStripButton4_Click(object sender, EventArgs e)
{
if (template != null)
{
template.Close();
template.Dispose();
}
template = new OrderTemplateView(mainUi);
template.StartPosition = FormStartPosition.CenterParent;
template.ShowDialog(mainUi);
}
`
TopMost' 'へのすべての参照を削除し、その後、mainUi.BringToFrontは()'、そして '' template.ShowDialog(mainUi)を呼び出す 'を呼び出す - 私はShowDialogの(への呼び出しにmainUiを渡している注意してください)。 – LordWilmore
これは、質問への答えを提供していません。批評をしたり、著者の説明を求めるには、投稿の下にコメントを残してください。 - 私は正しい答えであるために答えを更新しました@pylover [口コミより](/レビュー/低品質・ポスト/ 14089033) – pylover
。修正のための歓声。最適化を書式設定のすべての後 – LordWilmore