
oninitdialog函数中加入图像列表和关联按钮和图标m_images.create(24,24,ilc_color24|ilc_mask,1,0)。怎样使用图像列表合并两个图标,不用xor修饰与设备关联操作。图像列表一般应用于有大量小图片需要管理的场合,而且,很多windows95和windowsnt通用控件(列表观察和树观察等)要求通过图像列表提供图标。
备注
Microsoft.NET Framework 1.1 版中的 bug 可防止映像上出现TreeView节点时应用程序调用Application.EnableVisualStyles。A bug in Microsoft .NET Framework version 1.1 prevents images from appearing on TreeView nodes when your application calls Application.EnableVisualStyles. 若要解决此 bug,请调用Application.DoEvents在您Main方法后立即调用EnableVisualStyles。To work around this bug, call Application.DoEvents in your Main method immediately after calling EnableVisualStyles. 在中已修复此 bug .NET Framework 2.0.NET Framework 2.0。This bug is fixed in .NET Framework 2.0.NET Framework 2.0.
设置TreeView控件的ImageList属性设置为现有ImageList你想要使用的控件。Set the TreeView control's ImageList property to the existing ImageList control you wish to use.

可以在属性窗口中,使用在设计器或在代码中设置这些属性。These properties can be set in the designer with the Properties window, or in code.
TreeView1.ImageList = ImageList1
treeView1.ImageList = imageList1;
treeView1->ImageList = imageList1;

将节点设置ImageIndex和SelectedImageIndex属性。Set the node's ImageIndex and SelectedImageIndex properties. ImageIndex属性确定节点的正常和展开状态,显示的图像和SelectedImageIndex属性确定显示节点的所选状态的图像。The ImageIndex property determines the image displayed for the node's normal and expanded states, and the SelectedImageIndex property determines the image displayed for the node's selected state.
在代码中,或在树节点编辑器中vb treeview 图标,可以设置这些属性。These properties can be set in code, or within the TreeNode Editor. 若要打开树节点编辑器中vb treeview 图标,单击省略号按钮 (
) 旁边Nodes属性窗口上的属性。To open the TreeNode Editor, click the ellipsis button (
) next to the Nodes property on the Properties window.
' (Assumes that ImageList1 contains at least two images and
' the TreeView control contains a selected image.)
TreeView1.SelectedNode.ImageIndex = 0
TreeView1.SelectedNode.SelectedImageIndex = 1
// (Assumes that imageList1 contains at least two images and
// the TreeView control contains a selected image.)
treeView1.SelectedNode.ImageIndex = 0;
treeView1.SelectedNode.SelectedImageIndex = 1;

// (Assumes that imageList1 contains at least two images and
// the TreeView control contains a selected image.)
treeView1->SelectedNode->ImageIndex = 0;
treeView1->SelectedNode->SelectedImageIndex = 1;
发送有关以下对象的反馈:
此产品
也可以直接在 GitHub 上提供反馈。

此页面
也可以直接在 GitHub 上提供反馈。
正在加载反馈...
没有未决问题
没有已关闭的问题
在 GitHub 上查看
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-107835-1.html
五年后