• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 770
  • Last Modified:

Infragistics Listbar: How to change item image on mouseover

Hello,

I'm using an Infragistics Listbar and I'm wondering what's the best way to change an item's image when the mouse moves over it.  I tried this:

private void ListBar_MouseMove(object sender, MouseEventArgs e)
{
   System.Windows.Forms.Control c = this.ListBar.GetChildAtPoint(e.Location);
   //then I'll somehow cast c as a listbar item and change the image...
}

but c is always null.  I'm surprised that this functionality isn't already built into the control, but I can't find any useful examples and the help isn't very helpful.  

I'm new to C# but I've been developing in other languages for a while (most recently VB6).

Any help is appreciated.  Thanks!
0
bussd
Asked:
bussd
  • 3
  • 3
1 Solution
 
vo1dCommented:
what is Infragistics Listbar? a thirparty control?
if so, is there a sample control which i can download and check out?
0
 
bussdAuthor Commented:
Hi Vo1d,

It is a third party control and you can download a trial at

http://www.infragistics.com/downloads/downloadinfo.aspx?productid=129&type=0 

I haven't used the trial so I'm not sure how it's limited but hopefully it's functional enough to help.
0
 
vo1dCommented:
which .net framework do you use? 1.1 or 2.0?
i only have version 2.0, so i hope that they have the same functionality.
i will download it and make a test.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bussdAuthor Commented:
I'm also using 2.0

Thanks!
0
 
vo1dCommented:
k, think i found a way.
you have to use the MouseEnterElement and MouseLeaveElement if you wanna change the items images.

example for mouseenterelement:

private void ultraListBar1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e)
        {
            if (e.Element is Infragistics.Win.UltraWinListBar.ItemImageUIElement)
            {
                Infragistics.Win.UltraWinListBar.ItemImageUIElement uiElement = e.Element as Infragistics.Win.UltraWinListBar.ItemImageUIElement;
               
               //change the uiElement.Item.LargeImageIndex or uiElement.Item.SmallImageIndex or uiElement.Image here
               
            }            
        }

to check, which item you got you could use the property uiElement.Item.Index
0
 
bussdAuthor Commented:
Wow.  Impressively quick and useful solution.  Thank you!

I'm sure I'll have more questions as this project progresses. :)  
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now