ToolTipController 信息提示自定義內容和風格

寫到一個公共類庫中,要調用的地方實例化調用即可實現框框提示信息,如下圖


       /// System.Windows.Forms的一個控件,在其上面提示顯示
       /// 提示的標題默認(溫馨提示)
       /// 提示的信息默認(???)
       /// 提示顯示等待時間
       /// DevExpress.Utils.ToolTipType 顯示的類型
       /// DevExpress.Utils.ToolTipLocation 在控件顯示的位置
       /// 是否自動隱藏提示信息
       /// DevExpress.Utils.ToolTipIconType 顯示框圖表的類型
       /// 一個System.Windows.Forms.ImageList裝載Icon圖標的List,顯示的ToolTipIconType上,可以爲Null
       /// 圖標在ImageList上的索引,ImageList爲Null時傳0進去
       public void NewToolTip(Control ctl, string title, string content,int showTime, DevExpress.Utils.ToolTipType toolTipType,DevExpress.Utils.ToolTipLocation tipLocation,boolisAutoHide,DevExpress.Utils.ToolTipIconTypetipIconType,System.Windows.Forms.ImageList imgList,intimgIndex)
       {
           try
           {
               MyToolTipClt = new DevExpress.Utils.ToolTipController();
               args = MyToolTipClt.CreateShowArgs();
               content = (string.IsNullOrEmpty(content) ? "???" : content);
               title=string.IsNullOrEmpty(title) ? "溫馨提示" : title;
               MyToolTipClt.ImageList = imgList;
               MyToolTipClt.ImageIndex = (imgList == null ? 0 : imgIndex);
               args.AutoHide = isAutoHide;
               MyToolTipClt.ShowBeak = true;
               MyToolTipClt.ShowShadow = true;
            

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章