轉 wince程式 中使用Listview顯示表徵圖問題 (C#) .

來源:互聯網
上載者:User

標籤:blog   http   io   ar   os   使用   sp   for   on   

思路:

1、表單控制項:lstaqgl 【Listview控制項名稱】  imageList1【ImageList控制項】

2.  圖片路徑添加到—imageList1——Listview顯示圖片從 imageList1擷取

代碼如下:

        private void Add(DataTable dtOut)        {            try            {                // this.listView1.Items.Clear();                ListViewItem lv1;                int i = 0;                Bitmap btm = null;                //迴圈讀取儲存的圖片路徑及名字(這是從xml讀取資料存在datable)                foreach (DataRow dr in dtHgnoOptionone.Rows)                {                    //把當前這個圖片 初始化放在 Bitmap dr["Imgurl"].ToString() 是圖片路徑 xx.jpg                    btm = new Bitmap(@"Program Files\imagelistTest\" + dr["Imgurl"].ToString());                    // imageList1 是表單控制項                    imageList1.Images.Add((Image.FromHbitmap(btm.GetHbitmap())));                    //添加到list                    lstaqgl.SmallImageList = imageList1;                    ListViewItem lst = new ListViewItem(dr["Imgname"].ToString());                    lstaqgl.Items.Add(lst);                    lstaqgl.Items[i].ImageIndex = i;                    i++;                }                //釋放資源                btm.Dispose();            }            catch (Exception ex)            {                                            }        }

  

wince6.0 pda裝置

 

 

轉 wince程式 中使用Listview顯示表徵圖問題 (C#) .

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.