在C中如何使用imagelist

時間 2021-10-20 12:52:36

1樓:匿名使用者

private system.windows.forms.imagelist imagelist1;

this.imagelist1.imagestream = ((system.

windows.forms.imageliststreamer)(resources.

getobject("imagelist1.imagestream")));

this.imagelist1.transparentcolor = system.drawing.color.transparent;

//下面加幾個image

this.imagelist1.images.setkeyname(0, "acrobat.ico");

this.imagelist1.images.setkeyname(1, "address book.ico");

this.imagelist1.images.setkeyname(2, "adjust colour.ico");

//把imagelist1賦給treeview1

this.treeview1.imageindex = 0;

this.treeview1.imagelist = this.imagelist1;

this.treeview1.location = new system.drawing.point(3, 3);

this.treeview1.name = "treeview1";

this.treeview1.selectedimageindex = 0;

this.treeview1.size = new system.drawing.size(579, 450);

this.treeview1.tabindex = 0;

//以上code在designer完成

//在新增treenode的時候, 把image加上

//未選中時, 這個node顯示imagelist1中的"acrobat.ico", 選中後顯示"address book.ico"

treenode node = new treenode("treenodename", 0, 1);

treeview1.nodes.add(node);

treeview1.expandall();

2樓:匿名使用者

listimage.image=1;

在C 如何定義並使用陣列,在C 中的主函式中,如何定義一個陣列,而這個陣列的大小不確定,大小和數值由使用者從鍵盤輸入?

張老師情感分析 材料 工具 電腦方法如下 1 首先使用 string s new string 6 定義一個長度為6的字串陣列。2 接著使用 int i new int 6 定義一個長度為6的整型陣列,如下圖所示 3 使用 string str new string 定義長度為3的字串陣列,如下 4...

在c 中怎樣使用string型別

第一個肯定不行,string是需要usingnamespace std 改這樣就可以了.include include void sayhello std string void main void sayhello std string name std cout good morning 不要 ...

在C中,如何使用sql語句向資料庫中新增資訊

禹仙居安然 正常情況下,sql server中能實現的語句在c 中aqlcommand中執行是沒有問題,我們做開發的時候一般是sql server中先驗證查詢語句沒問題了才往c 中新增。您這裡導致這種情況的可能是 c 中字串的拼裝需要注意的一些問題,你可以在執行sqlcommand的 處斷點,然後檢...