Hi,
I have a UltraTreeView that has about 15 nodes each with a single child. If I have hot tracking turned on, and just run my mouse over the tree nodes (there is no mouse_over event) the images just dissapear after a few seconds of my constant mouse movement. The whole control tuns sluggish if I try to scroll left and right.
Worse yet, if I have tool tips enabled (override/tipstylenode) I get an out of memeory error with the above. I am using 10.2.20102.2026.
Thanks.
The ImageList.ImageCollection's indexer returns a clone of the image at that position every time it is accessed. When you add an integer to the LeftImages collection, the tree has no choice but to use the indexer to get the image, which means every time the control paints, it triggers the creation of dozens/hundreds/thousands of System.Drawing.Image instances.
When you add the images to the LeftImages collection, don't assign the index. Get a reference to the image via ImageList.Images[n], and add a reference to the Image instance to the LeftImages collection. Doing this will make it unnecessary for the control to access the ImageCollection's indexer, thus preventingthe OutOfMemoryException.
I am using 10.2.20102.2026.
There is NO mouse over event. The tree loads and each node has a left Image added (.LeftImages.Add(1)). There is an image list set to the tree.
After the tree loads, if I just take my mouse pointer, and move it back and forth over the nodes, I get the above picture. (I attached it and it wiped out my message).
I can't give you a small project unfortuantly, we have a rather large project and it would be hard for me to give JUST this section, plus it's tied to a database etc.
It's a bit hard to follow what you are describing. Are you saying that the MouseOver event of the control is not firing at all?
When you say the images are disappearing, what images are you referring to?
What version of the control are you using?
Can you post a small sample project demonstrating the issue?
Wish there was a way to edit a post.
Here is the full error. Furthermore in production, if I just run the program, watch the process and memory usage and just run my mout over two node back and forth the memroy goes CRAZY, up to about 2 GIGs, before dropping back down to 50K. This is a really big issue for us.
System.OutOfMemoryException: Out of memory. at System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette) at System.Drawing.Image.FromHbitmap(IntPtr hbitmap) at System.Windows.Forms.ImageList.GetBitmap(Int32 index) at System.Windows.Forms.ImageList.ImageCollection.get_Item(Int32 index) at System.Windows.Forms.ImageList.ImageCollection.get_Item(String key) at Infragistics.Win.UltraWinTree.NodeSelectableAreaUIElement.GetImage(Object image) at Infragistics.Win.UltraWinTree.NodeSelectableAreaUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements() at Infragistics.Win.UltraWinTree.UltraTreeUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements() at Infragistics.Win.UltraWinTree.UltraTree.OnMouseEnterElement(UIElementEventArgs e) at Infragistics.Win.UltraControlBase.Infragistics.Win.IUltraControl.FireMouseEnterElement(UIElementEventArgs e) at Infragistics.Win.ControlUIElementBase.ElementEntered(UIElement element, Boolean triggerMouseLeavesOnly) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at Infragistics.Win.UltraWinTree.UltraTree.OnMouseMove(MouseEventArgs e)