C# と VB.NET の質問掲示板

わんくま同盟

ASP.NET、C++/CLI、Java 何でもどうぞ

C# と VB.NET の入門サイト


(過去ログ 40 を表示中)
■20853 / )  Re[4]: notifyicon多重表示回避
□投稿者/ れれれ (69回)-(2008/06/18(Wed) 12:50:20)
No20845 (επιστημη さん) に返信
>> private void button1_Click(object sender, EventArgs e) //シリアル通信をおこなう
>> {
>> Mainclass main = new Mainclass(); // notifyicon多重表示
>> ・・・
>> }
>
> ボタンが押されるたんびに Mainclass が生成されてますが、これが"正しい使い方"なのですか?
> どこかで最初に一個だけ作っておいて、使いまわしてはいかんのでしょうか。
>
  private void button1_Click(object sender, EventArgs e) //シリアル通信をおこなう
  {
    Mainclass main = new Mainclass(); // notifyicon多重表示
    ・・・
  main.Dispose(); 
  }
としたらnotifyiconが多重表示されなくなりました(表示されてすぐ消える。)
解決済み
返信 編集キー/


管理者用

- Child Tree -