日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

VS2003 下GridControl的列显示成图片+文字的形式实现

發(fā)布時間:2025/6/17 56 豆豆
生活随笔 收集整理的這篇文章主要介紹了 VS2003 下GridControl的列显示成图片+文字的形式实现 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
public RC_CustomerSolicitListUC(){// 該調(diào)用是 Windows.Forms 窗體設(shè)計器所必需的。 InitializeComponent();// TODO: 在 InitializeComponent 調(diào)用后添加任何初始化//ADD BY TWH 2013-09-23,狀態(tài)列顯示為圖片+文字的形式SetStatusWithPic(gridView1, gridColumnStatus, false);}private void SetStatusWithPic(GridView aGridView1, GridColumn aColStatus, bool aOnlyImage){ImageList imageList = new ImageList();imageList.ImageSize = new Size(12, 12);imageList.ColorDepth = ColorDepth.Depth32Bit;imageList.Images.Add(GetImage("待招攬.png"));imageList.Images.Add(GetImage("招攬中.png"));imageList.Images.Add(GetImage("待招攬復談.png"));imageList.Images.Add(GetImage("待現(xiàn)場促進.png"));imageList.Images.Add(GetImage("待經(jīng)理復談.png"));imageList.Images.Add(GetImage("已成交.png"));imageList.Images.Add(GetImage("已戰(zhàn)敗.png"));imageList.TransparentColor = Color.Transparent;RepositoryItemImageComboBox repositoryItemImageComboBoxStatus = new RepositoryItemImageComboBox(); // aColStatus.ToolTip = "狀態(tài)";if (aOnlyImage){aColStatus.Width = 22;repositoryItemImageComboBoxStatus.Items.AddRange(new ImageComboBoxItem[]{new ImageComboBoxItem("",CustAllocStatus.PRE_SOLICIT,0),new ImageComboBoxItem("",CustAllocStatus.SOLICITING,1),new ImageComboBoxItem("",CustAllocStatus.PRE_SOLICIT_TALK,2),new ImageComboBoxItem("",CustAllocStatus.PRE_PROMOTE,3),new ImageComboBoxItem("",CustAllocStatus.PRE_MANAGER_TALK,4),new ImageComboBoxItem("",CustAllocStatus.DEALED,5),new ImageComboBoxItem("",CustAllocStatus.DEFEATED,6),});}else{repositoryItemImageComboBoxStatus.Items.AddRange(new ImageComboBoxItem[]{new ImageComboBoxItem("待招攬",CustAllocStatus.PRE_SOLICIT,0),new ImageComboBoxItem("招攬中",CustAllocStatus.SOLICITING,1),new ImageComboBoxItem("待招攬復談",CustAllocStatus.PRE_SOLICIT_TALK,2),new ImageComboBoxItem("待現(xiàn)場促進",CustAllocStatus.PRE_PROMOTE,3),new ImageComboBoxItem("待經(jīng)理復談",CustAllocStatus.PRE_MANAGER_TALK,4),new ImageComboBoxItem("已成交",CustAllocStatus.DEALED,5),new ImageComboBoxItem("已戰(zhàn)敗",CustAllocStatus.DEFEATED,6),});}repositoryItemImageComboBoxStatus.Name = "repositoryItemImageComboBoxStatus";repositoryItemImageComboBoxStatus.SmallImages = imageList;// aColStatus.ColumnEdit = repositoryItemImageComboBoxStatus;}private Image GetImage(string aFileName){// 從當前類型所在程序集里面提取“嵌入的資源文件”return new Bitmap(this.GetType(), aFileName);}

特別注意:增加的圖片一定要與UC控件在同一文件夾下否則GetImage方法會無法讀取到圖片資源,當然在VS2005后VS都自帶有Resources資源類,就不用像VS2003那樣有較大的限制了??梢灾苯訌腞esources中讀取

轉(zhuǎn)載于:https://www.cnblogs.com/ShaYeBlog/p/3335234.html

《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的VS2003 下GridControl的列显示成图片+文字的形式实现的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。