Hi,
I have a treeview which contains nodes of a class (classA) derived from
treenode.
These classA nodes may contain nodes of a class (ClassB) derived from
classA.
The form load populates a imagelist and calls a subroutine that assigns an
image to each node depending on its type.
If I expand a classA node, all is well. ie. I see the classA image on the
classA node and the classB image on the exposed classB node (which is always
a leaf node)
If I then click on the classB node it takes a classA image.
If I move further down the tree trunk and repeat this procedure on another
classA node the fault moves to this node / leaf node pair
ie. The first node / leaf node pair revert to the correct images.
It seems to me that it is something to do with selecting the leaf node, but
I have commented out my mouse event handlers and it still happens.
Also single stepping indicates that it is not in user defined code because
as soon as you step out of the mouse down event handler the code runs on
automatically and paints the form with the faulty image.
It is picking up image(0) from the imagelist.
Is this a known bug?
Is there a workaround?
thanks
Bob 5 1707
Bob,
Remember that TreeNode has both ImageIndex & SelectedImageIn dex. It is picking up image(0) from the imagelist.
It sounds like you set the ImageIndex & left SelectedImageIn dex at its
default of 0.
It also sounds like Class A nodes have ImageIndex=0, while Class B Nodes
have ImageIndex = 1 with SelectedImageIn dex = 0.
Hence whenever you select a node you are seeing Class A's image...
If you don't have an actual Selected Image. I would set both ImageIndex &
SelectedImageIn dex to the same value. Alternatively you could define both
images & selected images in your ImageList and set the ImageIndex &
SelectedImageIn dex properties of both classes appropriately.. .
Hope this helps
Jay
"Bob" <bo*@nowhere.co m> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. . Hi, I have a treeview which contains nodes of a class (classA) derived from treenode. These classA nodes may contain nodes of a class (ClassB) derived from classA. The form load populates a imagelist and calls a subroutine that assigns an image to each node depending on its type.
If I expand a classA node, all is well. ie. I see the classA image on the classA node and the classB image on the exposed classB node (which is always a leaf node)
If I then click on the classB node it takes a classA image.
If I move further down the tree trunk and repeat this procedure on another classA node the fault moves to this node / leaf node pair ie. The first node / leaf node pair revert to the correct images. It seems to me that it is something to do with selecting the leaf node, but I have commented out my mouse event handlers and it still happens. Also single stepping indicates that it is not in user defined code because as soon as you step out of the mouse down event handler the code runs on automatically and paints the form with the faulty image. It is picking up image(0) from the imagelist. Is this a known bug? Is there a workaround? thanks Bob
Jay,
I am prostrate at your feet!
Right On.
thanks
Bob
"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l... Bob, Remember that TreeNode has both ImageIndex & SelectedImageIn dex.
It is picking up image(0) from the imagelist. It sounds like you set the ImageIndex & left SelectedImageIn dex at its default of 0.
It also sounds like Class A nodes have ImageIndex=0, while Class B Nodes have ImageIndex = 1 with SelectedImageIn dex = 0.
Hence whenever you select a node you are seeing Class A's image...
If you don't have an actual Selected Image. I would set both ImageIndex & SelectedImageIn dex to the same value. Alternatively you could define both images & selected images in your ImageList and set the ImageIndex & SelectedImageIn dex properties of both classes appropriately.. .
Hope this helps Jay
"Bob" <bo*@nowhere.co m> wrote in message news:%2******** *******@TK2MSFT NGP15.phx.gbl.. . Hi, I have a treeview which contains nodes of a class (classA) derived from treenode. These classA nodes may contain nodes of a class (ClassB) derived from classA. The form load populates a imagelist and calls a subroutine that assigns
an image to each node depending on its type.
If I expand a classA node, all is well. ie. I see the classA image on
the classA node and the classB image on the exposed classB node (which is always a leaf node)
If I then click on the classB node it takes a classA image.
If I move further down the tree trunk and repeat this procedure on
another classA node the fault moves to this node / leaf node pair ie. The first node / leaf node pair revert to the correct images. It seems to me that it is something to do with selecting the leaf node, but I have commented out my mouse event handlers and it still happens. Also single stepping indicates that it is not in user defined code
because as soon as you step out of the mouse down event handler the code runs on automatically and paints the form with the faulty image. It is picking up image(0) from the imagelist. Is this a known bug? Is there a workaround? thanks Bob
Bob,
Please don't write that something is a bug before that is more sure, than we
have more change that Microsoft will look at real bugs.
Just my opinion
Cor
Cor,
It seems to me that Bob asked if it was a bug, I don't see that he stated
that it definitely is.
Although I agree, too many developers feel that the bug is in the Framework
or the OS, when "Select" isn't broken! http://www.pragmaticprogrammer.com/p...rule_list.html
Just a thought
Jay
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:ub******** ******@TK2MSFTN GP09.phx.gbl... Bob,
Please don't write that something is a bug before that is more sure, than we have more change that Microsoft will look at real bugs.
Just my opinion
Cor
Jay,
Does that not almost all fit for "us"?
:-)
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: SeanT |
last post by:
Greetings and salutations! I am having a real issue with the VB.NET
TreeView control. I need to display an image (a.k.a. logo, picture,
etc) from a file as the treenode object. I can not seem to find a way
to do this in .NET. I have tried the DrawImageUnscaled and thought
that was the way to go, but I was wrong. If anyone has any
suggestions, please help! The code I have currently follows:
Public Sub mTreeViewLoad(ByVal m_xmld As...
|
by: Matthew Woods |
last post by:
Hi, does anyone know how to select a treenode with the first click? the
first click on a treeview will highlight the node under the mouse when it
was clicked BUT that node isn't actually selected until you click on it
again - very annoying property. i know i have to handle an event to set the
selected node to be the highlighted node but i have no idea how.
Thanks for any help,
Matt
|
by: Mark Jerde |
last post by:
VS .NET 2003, Googling, msdn searching not successful.
I'm using the images of nodes of a TreeView to show the Pass/Fail results of
several tests. The tests are a little slow so I would like to Refresh()
between each test. This works:
MyTreeView.Refresh();
.... but it causes a lot of flicker. The node text does not change. Only
the TreeNode.ImageIndex changes.
|
by: Andrea |
last post by:
Hi,
Im using an ASP.NET 2.0 TreeView control on a web page with an Xml
MapSiteMenu. Some nodes does'nt have url property (just acts as container of
other children nodes).
My question is:
Can i open and close a treenode without clicking on +/- image (but just
clicking on the treenode caption (title property) ?
Thanks, Andrea.
|
by: Alan T |
last post by:
I am using VS 2005 and just wonder why I don't have this method?
| |
by: Lukas Kurka |
last post by:
Hi,
Is there a way how to add Controls into TreeNode?
Thank You
Lukas
|
by: WhiteWizard |
last post by:
Anyone out there today? Happy Thanksgiving!
I am writing a Window app that has a TreeView control. I am creating the
nodes dynamically from an XML file, and I have some icon images that I have
associated with each of the "top" nodes. The users, after some usability
testing, have decided they don't want the "child" nodes to have any icons
associated.
I cannot seem to get the child nodes to NOT have an icon. I have tried
changing...
|
by: AAaron123 |
last post by:
If you see this posted twice - sorry.
My news reader showed my first post as "No Longer Available"
I have the following in a .css file.
The treeNodes behave as if they were "a" elements.
I can't get them to not respond to the mouse!
|
by: Tom |
last post by:
I have your classic WinForm treeview that uses an image list with 2 images:
1. An open folder.
2. A closed folder.
The events that I have registered for are:
1. afterselect
2. afterexpand
3. aftercollapse
The AfterExpand and AfterCollapse events set the imageindex appropriately,
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |