C NotifyIcon 托盤控制項

2022-07-29 11:45:09 字數 683 閱讀 1428

右下角以圖示形式顯示,雙擊圖示顯示介面,最小化介面時不顯示在工作列。

第一步:

在介面上新增notifyicon控制項。

第二步:設定notifyicon1的屬性,新增圖示,將visible設為true。當然,visible也可以在**中設定,true是顯示在右下角,false不顯示。

第三步:notifyicon1新增事件,即雙擊顯示介面。

1

private

void notifyicon1_mousedoubleclick(object

sender, mouseeventargs e)

2

第四步:最小化介面時不顯示在工作列。

1

private

void formmain_resize(object

sender, eventargs e)

28 }

使用托盤控制項

using system using system.drawing using system.collections using system.componentmodel using system.windows.forms using system.data namespace notify 清...

WPF托盤控制項

開始執行的事件 新增基礎資訊 private void addtrayicon trayicon new notifyicon trayicon.visible true region 新增右鍵選單內容 例項化右鍵選單 contextmenu menu new contextmenu 新增選單的內容...

C 系統托盤 控制項NotifyIcon

notifyicon 控制項的常用屬性 屬性 icon 型別 system.drawing.icon 說明 將在系統工作列中顯示的圖示。可以在設計時指定,也可在執行時動態指定。屬性 text 型別 string 說明 用於指定當滑鼠停留在小圖示上時顯示的資訊。屬性 visible 型別 bool 說...