VB.NET, C#, PowerShellを使用しているエンジニアのためのサイト。
基本的な使用方法から開発で役立つTipsまで幅広く取り扱っています。
<< 前のTips 次のTips >>
パネルにアイコンを表示するには、StatusBarPanelのIconプロパティを使用します。
private void Form1_Load(object sender, System.EventArgs e) { StatusBarPanel stbPnl1 = new StatusBarPanel(); StatusBarPanel stbPnl2 = new StatusBarPanel(); StatusBarPanel stbPnl3 = new StatusBarPanel(); //各パネルに表示するテキストを指定 stbPnl1.Text = "ここにメッセージを表示"; stbPnl2.Text = "ホスト名:" + System.Net.Dns.GetHostName(); stbPnl3.Text = DateTime.Now.ToShortDateString(); //パネルにアイコンを表示(引数にはアイコンのあるパスを正しく設定してください) System.Drawing.Icon ico = new System.Drawing.Icon("App.ico"); stbPnl1.Icon = ico; //ステータスバーにパネルを追加 statusBar1.Panels.Add(stbPnl1); statusBar1.Panels.Add(stbPnl2); statusBar1.Panels.Add(stbPnl3); //パネルを表示する statusBar1.ShowPanels = true; }
<< 前のTips 次のTips >>