タスクバー - タスクトレイ
トレイアイコンにポップアップメッセージを表示したい
TrayIconクラスを利用すると、Windowsのタスクトレイへ専用のアイコンを表示する事ができます。
popupMessageメソッドを利用するとセットしたトレイアイコンのポップアップメッセージを表示する事も可能です。 また、ポップアップメッセージがクリックされた事をMessageClickedイベントで検知する事も可能です。
Form form1 { width = 511; height = 374; TrayIcon ti{ Function OnMessageClicked(e){ ^.label1.value = "ポップアップメッセージがクリックされました。"; } } ComboBox comboBox1{ x = 72; y = 64; width = 336; height = 40; ComboItem item[]; item << CSV( .value, .title ){ 0,アイコンなし(POPUP_DEFAULT) 1,情報アイコン(POPUP_INFORMATION) 2,警告アイコン(POPUP_WARNING) 3,エラーアイコン(POPUP_CRITICAL)}; } Button button3 { x = 72; y = 136; width = 344; height = 56; title = "トレイアイコンにポップアップメッセージ表示"; Function OnTouch(e){ ^.label1.clear(); ^.ti.popupMessage( "ポップアップメッセージ", ^.comboBox1.item[^.comboBox1.listIndex].title, ^.comboBox1.item[^.comboBox1.listIndex].value); } } Label label1 { x = 72; y = 216; width = 344; height = 56; font = new Font("MS UI Gothic", 14, true); } if (!Application.DESIGNTIME) { # トレイアイコン表示 ti.visible = true; } }
Biz-Collections Bizの宝箱 トップへ
Biz/Browser DT・Biz/Designer DT TIPS集 トップへ