Listview SubItems图像索引 [英] Listview SubItems image index

查看:81
本文介绍了Listview SubItems图像索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但是哦,我找不到答案

通过代码查看。


已经有了一个图像列表,如何设置列表视图的图标'

项目?


我正在使用下面的代码,但子项目没有有一个超载

允许图像索引。


亚当


***代码***


lvItem = lvControl.Items.Add(sData,0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 +"" + CType(iCounter, String),

" Program name",MyAccountsINIFilePath)

lvItem.SubItems.Add(sData)< --------不能在这里添加图像索引

This is probably a silly question but oh well, I can''t find the answer
looking via code.

Having an imagelist already, how does one set an icon for a list view''s sub
items?

I''m using the code below however the subitems doesn''t have an overload
allowing an image index.

Adam

***Code***

lvItem = lvControl.Items.Add(sData, 0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 + " " + CType(iCounter, String),
"Program name", MyAccountsINIFilePath)

lvItem.SubItems.Add(sData) <-------- Cannot add image index here

推荐答案

Adam,


找到这种方法的最简单方法是看看它是如何完成的

设计师。

因此创建一个小项目,使用设计师这样做,看看如何

他们做到了。我还没有看到设计师制作的代码是愚蠢的

完成。


我希望这有帮助,


Cor


" Adam Honek" <广告******* @ Webmaster2001.freeserve.co.uk> schreef在bericht

新闻:eN ************** @ TK2MSFTNGP02.phx.gbl ...
Adam,

The simplest method to find this kind of methods is to look how it is done
in the designer.
Therefore create a small project, do this using the designer and see how
they done it. I have not seen yet code made by the designer that was stupid
done.

I hope this helps,

Cor

"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> schreef in bericht
news:eN**************@TK2MSFTNGP02.phx.gbl...
这可能是个傻瓜问题,但是哦,我找不到答案
通过代码查看。

已经有一个图像列表,如何为列表视图设置图标子项?

我正在使用下面的代码,但子项目没有超载
允许图像索引。

Adam

***代码***

lvItem = lvControl.Items.Add(sData,0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 +"" ; + CType(iCounter,
String),Program name,MyAccountsINIFilePath)

lvItem.SubItems.Add(sData)< --------无法添加图像这里索引
This is probably a silly question but oh well, I can''t find the answer
looking via code.

Having an imagelist already, how does one set an icon for a list view''s
sub items?

I''m using the code below however the subitems doesn''t have an overload
allowing an image index.

Adam

***Code***

lvItem = lvControl.Items.Add(sData, 0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 + " " + CType(iCounter,
String), "Program name", MyAccountsINIFilePath)

lvItem.SubItems.Add(sData) <-------- Cannot add image index here



AFAIK,.NET没有内置支持。作为替代方案,请参阅:


带有SubItems图像的ListView
http://www.codeproject.com/cs/miscctrl/OAKListView.asp


-
< br $>
祝你好运,

Carlos J. Quintero


MZ-Tools:Visual Studio的生产力加载项

您可以更快地编码,设计和记录:
http:/ /www.mztools.com

" Adam Honek" <广告******* @ Webmaster2001.freeserve.co.uk> escribiónelel

mensaje新闻:eN ************** @ TK2MSFTNGP02.phx.gbl ...
AFAIK, .NET does not built-in support for that. As alternative, see:

ListView with Image on SubItems
http://www.codeproject.com/cs/miscctrl/OAKListView.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> escribió en el
mensaje news:eN**************@TK2MSFTNGP02.phx.gbl...
这可能是一个愚蠢的问题,但哦,我找不到答案
通过代码看。

已经有一个图像列表,如何设置列表视图的图标'br />子项目?

我正在使用下面的代码,但子项目没有超载
允许图像索引。

Adam < *** />
***代码***

lvItem = lvControl.Items.Add(sData,0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 +" " + CType(iCounter,
String)," Program name",MyAccountsINIFilePath)

lvItem.SubItems.Add(sData)< --------无法添加这里的图像索引
This is probably a silly question but oh well, I can''t find the answer
looking via code.

Having an imagelist already, how does one set an icon for a list view''s
sub items?

I''m using the code below however the subitems doesn''t have an overload
allowing an image index.

Adam

***Code***

lvItem = lvControl.Items.Add(sData, 0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 + " " + CType(iCounter,
String), "Program name", MyAccountsINIFilePath)

lvItem.SubItems.Add(sData) <-------- Cannot add image index here



你好!

我们目前正在vb.net 2005上开发一个PocketPc应用程序。我们需要使用ListView,但子项目中包含图像,这是



我尝试了以下链接...

http://www.codeproject.com/cs/miscctrl/OAKListView.asp

尝试将c#代码转换为VB时,我遇到了一些问题。 />

特别是Button_clickevent中的SendMessage()函数调用
抛出一个System.NotSupportedException ...


可能有人建议解决方案或提供VB.NET编码链接上面的

问题..?


谢谢,

Adam Honek写道:
Hello!
We are currently working on a PocketPc application in vb.net 2005.It is
reqired that we use a ListView , but with images in the sub items.
I tried the link below...

http://www.codeproject.com/cs/miscctrl/OAKListView.asp

I has some problems when trying to convert the c# code to VB.

In particular the SendMessage() function call in the Button_clickevent
throws a System.NotSupportedException ...

Could anyone suggest a solution or provide a link with VB.NET coding for the
above problem..?

Thanks,
"Adam Honek" wrote:
这可能是一个愚蠢的问题,但是哦,我找不到答案
通过代码查找。

有一个imagelist已经,如何为列表视图的子项设置图标?

我正在使用下面的代码,但子项没有过载<允许图像索引。

Adam

***代码***

lvItem = lvControl.Items.Add(sData, 0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 +"" + CType(iCounter,String),
" Program name",MyAccountsINIFilePath)

lvItem。 SubItems.Add(sData)< --------无法在此处添加图像索引
This is probably a silly question but oh well, I can''t find the answer
looking via code.

Having an imagelist already, how does one set an icon for a list view''s sub
items?

I''m using the code below however the subitems doesn''t have an overload
allowing an image index.

Adam

***Code***

lvItem = lvControl.Items.Add(sData, 0)

sData = ReadINIFileValue(INI_SECTION_TYPE1 + " " + CType(iCounter, String),
"Program name", MyAccountsINIFilePath)

lvItem.SubItems.Add(sData) <-------- Cannot add image index here



这篇关于Listview SubItems图像索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆