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 treeview control set to the imagelist
containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed next to
the nodes during runtime. I tried creating nodes during designtime using
the Nodes property, and the image appears next to the node in the designer
like it should, but when I run the app, there's no image visible, just a
blank space where the image is supposed to be followed by the node text.
Does this even when I add nodes at runtime, using code:
MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0))
0 is the index of the image in the imagelist that I want displayed.
I just noticed it does this with everything that uses the imagelist! The
toolbar, listview, treeview; everything behaves the same.
Also, this didn't always be a problem. It started acting this way when I
cut and pasted an imagelist control to a different form in one of my
projects. Its not a project-specific problem either, because I started a
new project and it does the same thing. I've tried restarting, running a
repair installation on VB.NET, nothing will fix it.
Even when I run the compiled app on another PC, same thing.
Anyone else having this weird problem? It's becoming very frustrating, and
would love to hear anyone's ideas. Thanks a lot.
Andrew 7 2066
Hi,
I had a similar problem with a toolbar a while ago. Look in the
Windows Form Designer generated code region. Make sure the imagelist is
created before the treeview.
Ken
-------------------------------
"Andrew Christiansen" <no-spam> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl... 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 treeview control set to the
imagelist containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed next
to the nodes during runtime. I tried creating nodes during designtime using the Nodes property, and the image appears next to the node in the designer like it should, but when I run the app, there's no image visible, just a blank space where the image is supposed to be followed by the node text. Does this even when I add nodes at runtime, using code:
MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0)) 0 is the index of the image in the imagelist that I want displayed.
I just noticed it does this with everything that uses the imagelist! The toolbar, listview, treeview; everything behaves the same.
Also, this didn't always be a problem. It started acting this way when I cut and pasted an imagelist control to a different form in one of my projects. Its not a project-specific problem either, because I started a new project and it does the same thing. I've tried restarting, running a repair installation on VB.NET, nothing will fix it.
Even when I run the compiled app on another PC, same thing.
Anyone else having this weird problem? It's becoming very frustrating,
and would love to hear anyone's ideas. Thanks a lot.
Andrew
Tried that just now. I was excited because it sounded like it would solve
the problem, doesn't. I moved the block of code that sets the properties of
the imagelist:
'
ImageList1
'
Blah .........
Above where the listview is, and still no luck. Dang I'm getting very
frusterated I can't really do much of anything until I get this fixed, I've
been working on this problem for like 3 days now. Any other ideas? Is that
all you did to fix the toolbar problem you had? Thanks.
Andrew
"Andrew Christiansen" <no-spam> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl... 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 treeview control set to the
imagelist containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed next
to the nodes during runtime. I tried creating nodes during designtime using the Nodes property, and the image appears next to the node in the designer like it should, but when I run the app, there's no image visible, just a blank space where the image is supposed to be followed by the node text. Does this even when I add nodes at runtime, using code:
MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0)) 0 is the index of the image in the imagelist that I want displayed.
I just noticed it does this with everything that uses the imagelist! The toolbar, listview, treeview; everything behaves the same.
Also, this didn't always be a problem. It started acting this way when I cut and pasted an imagelist control to a different form in one of my projects. Its not a project-specific problem either, because I started a new project and it does the same thing. I've tried restarting, running a repair installation on VB.NET, nothing will fix it.
Even when I run the compiled app on another PC, same thing.
Anyone else having this weird problem? It's becoming very frustrating,
and would love to hear anyone's ideas. Thanks a lot.
Andrew
I had the same problem when I used Application.EnableVisualStyles, my
existing toolbar icons didn't display their icons.
Another thing, the depth of the image may not be supported by your video
card, check the depth property of the image in the imagelist. Just some
extra suggestions.
"Andrew Christiansen" <no-spam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl... Tried that just now. I was excited because it sounded like it would solve the problem, doesn't. I moved the block of code that sets the properties
of the imagelist:
' ImageList1 ' Blah .........
Above where the listview is, and still no luck. Dang I'm getting very frusterated I can't really do much of anything until I get this fixed,
I've been working on this problem for like 3 days now. Any other ideas? Is
that all you did to fix the toolbar problem you had? Thanks.
Andrew
"Andrew Christiansen" <no-spam> wrote in message news:O1**************@TK2MSFTNGP11.phx.gbl... 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 treeview control set to the imagelist containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed next to the nodes during runtime. I tried creating nodes during designtime
using the Nodes property, and the image appears next to the node in the
designer like it should, but when I run the app, there's no image visible, just a blank space where the image is supposed to be followed by the node text. Does this even when I add nodes at runtime, using code:
MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0)) 0 is the index of the image in the imagelist that I want displayed.
I just noticed it does this with everything that uses the imagelist!
The toolbar, listview, treeview; everything behaves the same.
Also, this didn't always be a problem. It started acting this way when
I cut and pasted an imagelist control to a different form in one of my projects. Its not a project-specific problem either, because I started
a new project and it does the same thing. I've tried restarting, running
a repair installation on VB.NET, nothing will fix it.
Even when I run the compiled app on another PC, same thing.
Anyone else having this weird problem? It's becoming very frustrating, and would love to hear anyone's ideas. Thanks a lot.
Andrew
Wow, I commented out the Application.EnableVisualStyles method that I was
calling in Sub Main() and, voulia, the image was there. Hmmm.... should I
call EnableVisualStyles elsewhere to keep it from doing that? Thanks!
Andrew
"Jared" <VB***********@email.com> wrote in message
news:vu************@corp.supernews.com... I had the same problem when I used Application.EnableVisualStyles, my existing toolbar icons didn't display their icons. Another thing, the depth of the image may not be supported by your video card, check the depth property of the image in the imagelist. Just some extra suggestions.
"Andrew Christiansen" <no-spam> wrote in message news:uo**************@TK2MSFTNGP10.phx.gbl... Tried that just now. I was excited because it sounded like it would
solve the problem, doesn't. I moved the block of code that sets the
properties of the imagelist:
' ImageList1 ' Blah .........
Above where the listview is, and still no luck. Dang I'm getting very frusterated I can't really do much of anything until I get this fixed, I've been working on this problem for like 3 days now. Any other ideas? Is that all you did to fix the toolbar problem you had? Thanks.
Andrew
"Andrew Christiansen" <no-spam> wrote in message news:O1**************@TK2MSFTNGP11.phx.gbl... 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 treeview control set to the imagelist containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed
next to the nodes during runtime. I tried creating nodes during designtime using the Nodes property, and the image appears next to the node in the designer like it should, but when I run the app, there's no image visible, just
a blank space where the image is supposed to be followed by the node
text. Does this even when I add nodes at runtime, using code:
MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0)) 0 is the index of the image in the imagelist that I want displayed.
I just noticed it does this with everything that uses the imagelist! The toolbar, listview, treeview; everything behaves the same.
Also, this didn't always be a problem. It started acting this way
when I cut and pasted an imagelist control to a different form in one of my projects. Its not a project-specific problem either, because I
started a new project and it does the same thing. I've tried restarting,
running a repair installation on VB.NET, nothing will fix it.
Even when I run the compiled app on another PC, same thing.
Anyone else having this weird problem? It's becoming very
frustrating, and would love to hear anyone's ideas. Thanks a lot.
Andrew
Figured it out! For everyone having this problem, call Application.DoEvents
right after calling EnableVisualStyles, it will enable the styles plus keep
the images intact. I have no idea why calling DoEvents fixes the problem,
but it does. The article I read that told me this said that there was
probably some message that gets filtered out upon calling EnableVisualStyles
that keeps the images from being visible, but when you call DoEvents the
message gets processed. Makes sense.
Thanks.
Andrew
"Andrew Christiansen" <no-spam> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl... Wow, I commented out the Application.EnableVisualStyles method that I was calling in Sub Main() and, voulia, the image was there. Hmmm.... should I call EnableVisualStyles elsewhere to keep it from doing that? Thanks!
Andrew
"Jared" <VB***********@email.com> wrote in message news:vu************@corp.supernews.com... I had the same problem when I used Application.EnableVisualStyles, my existing toolbar icons didn't display their icons. Another thing, the depth of the image may not be supported by your video card, check the depth property of the image in the imagelist. Just some extra suggestions.
"Andrew Christiansen" <no-spam> wrote in message news:uo**************@TK2MSFTNGP10.phx.gbl... Tried that just now. I was excited because it sounded like it would solve the problem, doesn't. I moved the block of code that sets the properties of the imagelist:
' ImageList1 ' Blah .........
Above where the listview is, and still no luck. Dang I'm getting very frusterated I can't really do much of anything until I get this fixed, I've been working on this problem for like 3 days now. Any other ideas?
Is that all you did to fix the toolbar problem you had? Thanks.
Andrew
"Andrew Christiansen" <no-spam> wrote in message news:O1**************@TK2MSFTNGP11.phx.gbl... > 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 treeview control set to the imagelist > containing the images I want to be displayed next to each node. > > It seems that no matter what I do there will be no images displayed next to > the nodes during runtime. I tried creating nodes during designtime using > the Nodes property, and the image appears next to the node in the designer > like it should, but when I run the app, there's no image visible,
just a > blank space where the image is supposed to be followed by the node text. > Does this even when I add nodes at runtime, using code: > > MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0)) > 0 is the index of the image in the imagelist that I want displayed. > > I just noticed it does this with everything that uses the imagelist! The > toolbar, listview, treeview; everything behaves the same. > > Also, this didn't always be a problem. It started acting this way when I > cut and pasted an imagelist control to a different form in one of my > projects. Its not a project-specific problem either, because I started a > new project and it does the same thing. I've tried restarting, running a > repair installation on VB.NET, nothing will fix it. > > Even when I run the compiled app on another PC, same thing. > > Anyone else having this weird problem? It's becoming very frustrating, and > would love to hear anyone's ideas. Thanks a lot. > > Andrew > >
Hi Andrew,
That is greath this message because this is a workaround for what I thought
I have often seen in this newsgroup mentioned as something that was
imposible.
Cor Figured it out! For everyone having this problem, call
Application.DoEvents right after calling EnableVisualStyles, it will enable the styles plus
keep the images intact. I have no idea why calling DoEvents fixes the problem, but it does. The article I read that told me this said that there was probably some message that gets filtered out upon calling
EnableVisualStyles that keeps the images from being visible, but when you call DoEvents the message gets processed. Makes sense.
Sorry, should have told you to use the DoEvents after EnbaleVisualStyles. I
thought the documentation said you should always do it. I must have started
using it when I first had the problem and just made it mandatory in my mind.
I guess I could have saved you a little time. Sorry about that.
Jared
"Cor" <no*@non.com> wrote in message
news:O4**************@TK2MSFTNGP11.phx.gbl... Hi Andrew,
That is greath this message because this is a workaround for what I
thought I have often seen in this newsgroup mentioned as something that was imposible.
Cor
Figured it out! For everyone having this problem, call Application.DoEvents right after calling EnableVisualStyles, it will enable the styles plus keep the images intact. I have no idea why calling DoEvents fixes the
problem, but it does. The article I read that told me this said that there was probably some message that gets filtered out upon calling EnableVisualStyles that keeps the images from being visible, but when you call DoEvents the message gets processed. Makes sense.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David |
last post by:
I have a problem that just cropped up with using an ImageList in my project
I am using VB .NET 200
Problem:
I have existing Form with 2 Image List controls. ImageList16 (for 16x16 Images) and...
|
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...
|
by: Mitchell Vincent |
last post by:
I've been trying to get a standard toolbar to play nice with some nice icons
that I have. When I put them on a button or anything they look perfect, but
through an imagelist and on a toolbar they...
|
by: johnb41 |
last post by:
In my app, I need to open up a multipage tiff file, and also display
it's thumbnail images IN HIGH QUALITY. (High Quality meaning
anti-aliased, and looking good; not rough and pixely) The...
|
by: |
last post by:
I do not want to setup and create my ImageList over and over again on
different forms in my project.
Is there any ways to achieve it? so that I will be more easy to manage my
ImageList as well as...
|
by: DK |
last post by:
I have an image list control on a user control that I'm trying to access
from the main form. I've tried different code but can't get it. I get an
error: Cannot convert type...
|
by: =?Utf-8?B?S2VuTg==?= |
last post by:
We're using a System.Windows.Forms.ImageList to store a bunch of Images that
I've loaded, and rendering each image in the ImageList during a draw loop.
The process was running unusually slow and...
|
by: raknin |
last post by:
Hi
I have a carousel script. I want to load the carousel with a new set of pictures every time I press a button. The problem that I have that the script append the new pictures to the olds one...
|
by: Phil Stanton |
last post by:
I am using an imageList control for a tree menu. Works fine
Problem I have is using VB to populate the ImageList
Basically I have a table of Icons that I wish to use. They point to a folder...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
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...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
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...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
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)...
| |