473,378 Members | 1,410 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

listbox with icons , C#

Hello,

I want to create a listbox with icons.

Icon1 --- Item1 ----comment01
Icon1 --- Item2 ----comment01
Icon1 --- Item3 ----comment01
Icon2 --- Item4 ----comment01
Icon1 --- Item5 ----comment01
Icon2 --- Item6 ----comment06
......
Icon2 --- ItemN ----comment0N

The listbox have 10 entries. After then, the scrollbar should be appears.
If Entries 500 I want to delete the oldest item.

The icon is depend from the state. I need more than 2 icons.

Addtional I need a log file for all items entries.
Every day a new log file.

How can i make that?

Best regards Thomas
Jun 28 '07 #1
4 7537
Hi,

You cannot do this with the stock Listbox, you have two options:
1- Implement your own control
2- Use a third party tool. I use Infragistics and they have a combobox
control that have this feature you want.

"Thomas Adler" <th***********@nospam.arcornews.dewrote in message
news:46***********************@newsspool4.arcor-online.net...
Hello,

I want to create a listbox with icons.

Icon1 --- Item1 ----comment01
Icon1 --- Item2 ----comment01
Icon1 --- Item3 ----comment01
Icon2 --- Item4 ----comment01
Icon1 --- Item5 ----comment01
Icon2 --- Item6 ----comment06
.....
Icon2 --- ItemN ----comment0N

The listbox have 10 entries. After then, the scrollbar should be appears.
If Entries 500 I want to delete the oldest item.

The icon is depend from the state. I need more than 2 icons.

Addtional I need a log file for all items entries.
Every day a new log file.

How can i make that?

Best regards Thomas

Jun 28 '07 #2
On Thu, 28 Jun 2007 10:43:26 -0700, Thomas Adler
<th***********@nospam.arcornews.dewrote:
Hello,
Hi.
I want to create a listbox with icons.
You can override the DrawItem and related events to draw the icon as you
like. If you can use a ListView instance instead, then that offers the
various ImageList properties (LargeImageList, SmallImageList,
StateImageList) that you can use to easily assign specific icons to list
items.
Icon1 --- Item1 ----comment01
Icon1 --- Item2 ----comment01
Icon1 --- Item3 ----comment01
Icon2 --- Item4 ----comment01
Icon1 --- Item5 ----comment01
Icon2 --- Item6 ----comment06
.....
Icon2 --- ItemN ----comment0N

The listbox have 10 entries. After then, the scrollbar should be appears.
If Entries 500 I want to delete the oldest item.
The scrollbar you can just enable. The removal of the oldest item you
will have to do yourself.
The icon is depend from the state. I need more than 2 icons.
See above.
Addtional I need a log file for all items entries.
Every day a new log file.
This is separate from the ListBox or ListView class. You'll have to write
some other code to write out the log file entries as they are added to the
ListBox or ListView.

Pete
Jun 28 '07 #3
Hello together,

thanks for the response.
Icon1 --- Item1 ----comment01
Icon1 --- Item2 ----comment01
Icon1 --- Item3 ----comment01
Icon2 --- Item4 ----comment01
Icon1 --- Item5 ----comment01
Icon2 --- Item6 ----comment06
.....
Icon2 --- ItemN ----comment0N
The listbox have 10 entries. After then, the scrollbar should be appears.
If Entries 500 I want to delete the oldest item.

The scrollbar you can just enable. The removal of the oldest item you
will have to do yourself.
The icon is depend from the state. I need more than 2 icons.

See above.
Addtional I need a log file for all items entries.
Every day a new log file.

This is separate from the ListBox or ListView class. You'll have to write
some other code to write out the log file entries as they are added to the
ListBox or ListView.
Have you a link or code example?
Maybe first, without icons. It is easier.

Thanks.

Regards Thomas

Jun 29 '07 #4
Hi,
"Thomas Adler" <th***********@arcor.dewrote in message
news:11**********************@w5g2000hsg.googlegro ups.com...
Hello together,

thanks for the response.
Icon1 --- Item1 ----comment01
Icon1 --- Item2 ----comment01
Icon1 --- Item3 ----comment01
Icon2 --- Item4 ----comment01
Icon1 --- Item5 ----comment01
Icon2 --- Item6 ----comment06
.....
Icon2 --- ItemN ----comment0N
The listbox have 10 entries. After then, the scrollbar should be
appears.
If Entries 500 I want to delete the oldest item.

The scrollbar you can just enable. The removal of the oldest item you
will have to do yourself.
The icon is depend from the state. I need more than 2 icons.

See above.
Addtional I need a log file for all items entries.
Every day a new log file.

This is separate from the ListBox or ListView class. You'll have to
write
some other code to write out the log file entries as they are added to
the
ListBox or ListView.
Have you a link or code example?
Maybe first, without icons. It is easier.

I was looking into creating a owner drawing control (a listbox) a time ago.
These links helped me a lot
http://samples.gotdotnet.com/quickst...awListBox.aspx
http://www.opennetcf.org/permalink2....8-94ab3c124f63

I was targeting the compact framework so I used more the second link.
Jun 29 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bernie Yaeger | last post by:
I now know how to gather the file type icons and I'm able to use them in a listview. But a listbox does not have a .smallimagelist or .largeimagelist member, so I don't know how to translate that...
1
by: desmcc | last post by:
Does anyone know how to have the standard order icons you quite often see above a listbox or list view. These controls allow you to change the order of the selected item within the list box/ list...
3
by: Mamatha | last post by:
Hi I want to develop my application and displaying icons with the items in the listbox.For example i have displayed some webpage paths in the listbox and i want to display an icon (Internet...
2
by: Limin | last post by:
I add some picturebox in the listbox as controls like following. Dim myPic as PictureBox 'Init myPic from here '... '... for i=0 to 30 'New picturebox '... 'set mypic property '....
1
by: Melson | last post by:
Hi May I know what is the differences between vb.net listbox and listview. When should I use listbox or listview. Regards Melson
0
by: martins | last post by:
Hi is there any control in VB.NET that I can use to add a icon to each item collection ? i.e. a listbox has a item collection, and I want to add a small icon to each item can this be done...
1
by: Richard | last post by:
I'm writing code to compare two directories side-by-side, like FolderMatch or FolderSync. I've used ListBoxes in VB6, so have the idea about concatenating strings for list items, but have no...
4
by: mikkoO8 | last post by:
hi. im actually making a desktop cleaner that can move the files and icons to a folder inside the listview box. i can make the listview box filled with files contains at the desktop and i can make...
0
by: =?Utf-8?B?QmVu?= | last post by:
Hi I have this list box with 2 columns. In column 1 I want to but an Icon to represent a person name in column 2 Because, I want to to have the listview selection color different from the system...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.