473,320 Members | 1,820 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,320 software developers and data experts.

ImageList with ListView and TreeView

Ian
Hi, I've been trying to create a listview and treeview with icons. You
would think it's a pretty straight forward task. API documentation
states you simply assign an ImageList - that's been populated either
using VS.NET (my method) or programatically.

I assigned the imagelist to the small icons in the listview.

Even VS.NET has been satisfied with what I'm doing as it shows the
listitems/treenodes with icons. As soon as I build/run however, all
icons are missing.

One thing to note is I had originally extended a standard list, added
the images using the extended class (using the very same listview) and
it worked. Unfortunately, a list isn't powerful enough for my
purposes.

I've spent 10 hours (prob more) trying to fix this. I've installed all
possible patches, examined my code line-by-line. Tried to reproduce
the .net API examples. Nothing.

Has anyone had a similar issue? If so - Please help... please?
Nov 15 '05 #1
3 12144
Hi,

Sounds really weird, the only thing that comes to my mind is that when you
use WinXP, you should call Application.DoEvents prior to calling
Application.Run(). You can find more on this in the "Applying Windows XP
Visual Styles to Windows Forms Applications" topic in MSDN.

To quote the article:

<quote>
Note If one of the controls on your form is an ImageList control, be sure
to include the following line of code before calling Application.Run().

// C#
Application.DoEvents();
</quote>

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ian" <he******@hotmail.com> wrote in message
news:e7**************************@posting.google.c om...
Hi, I've been trying to create a listview and treeview with icons. You
would think it's a pretty straight forward task. API documentation
states you simply assign an ImageList - that's been populated either
using VS.NET (my method) or programatically.

I assigned the imagelist to the small icons in the listview.

Even VS.NET has been satisfied with what I'm doing as it shows the
listitems/treenodes with icons. As soon as I build/run however, all
icons are missing.

One thing to note is I had originally extended a standard list, added
the images using the extended class (using the very same listview) and
it worked. Unfortunately, a list isn't powerful enough for my
purposes.

I've spent 10 hours (prob more) trying to fix this. I've installed all
possible patches, examined my code line-by-line. Tried to reproduce
the .net API examples. Nothing.

Has anyone had a similar issue? If so - Please help... please?


Nov 15 '05 #2
Ian
THANK YOU!

THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
THANK YOU! THANK YOU! THANK YOU! ... THANK YOU!

Your suggestion worked!

Of course, it's always something simple like that :| 25 hours on one
little problem and it comes down to 30 odd characters of text!

Once again, thank you. I honestly thought no one would know what the
problem was - let alone care.
Nov 15 '05 #3
Ian,

I am really glad my suggestion has worked! Also keep in mind that, on WinXP,
the format to which ImageLists are serialized when stored in resource files
is *different* to that on Win2K and earlier versions.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ian" <he******@hotmail.com> wrote in message
news:e7**************************@posting.google.c om...
THANK YOU!

THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
THANK YOU! THANK YOU! THANK YOU! ... THANK YOU!

Your suggestion worked!

Of course, it's always something simple like that :| 25 hours on one
little problem and it comes down to 30 odd characters of text!

Once again, thank you. I honestly thought no one would know what the
problem was - let alone care.


Nov 15 '05 #4

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

Similar topics

2
by: brunchto | last post by:
Hi, I've this code: Dim ImageList1 As New ImageList ImageList1.Images.Add(Image.FromFile("..\images\statusOK.bmp")) ImageList1.Images.Add(Image.FromFile("..\images\statusKO.bmp"))...
2
by: Bob C. | last post by:
Hi All, I am using the ImageList/ListView Components to display around 100 images in C#.NET. The issue i have is, some times i may need to display the thumbnail of size more then 256x256 in...
1
by: paradox | last post by:
I want to have a TreeView that shows an image on some items, but not all. Basically, if a certain condition is true, a caution icon is placed next to the treeview item. The problem is that, by...
0
by: morten skrubbeltrang | last post by:
According to KB article 822488 http://support.microsoft.com/default.aspx?scid=kb;en-us;822488 visual c# .net 2002 + 2003 has bug in rendering of alpha channel information when displaying a...
7
by: Andrew Christiansen | last post by:
Hey everyone. I have Visual Basic .NET 2003 and am trying to show images on a treeview control. I have the imagelist on the form filled with images, and have the ImageList property of the...
0
by: Andre Viens | last post by:
Hello, I am using the following variation of code from <http://support.microsoft.com/default.aspx?scid=kb;EN-US;319340> to add icons to an imagelist for use in a listview: Private Structure...
2
by: sonu | last post by:
Hi, I have a problem for use of imagelist. The problem is I have written a code which returns me the icons associated with the files depending on their type. After getting the icon for the...
0
by: gene kelley | last post by:
(using VS2005) I want to add an icon to TreeView nodes. 1) To a new project (VB or C#) I add a sample TreeView with some sample nodes. I add an ImageList component, and add one icon image. I...
0
by: crealas | last post by:
I'm currently building a GUI in C# using Microsoft Visual Studio 2005. I have put together an Explorer style control as explained in the walkthrough in the Visual Studio 2005 help. I got it...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.