Infragistics Listbar:  How to change item image on mouseover

Posted on 2006-04-22
Last Modified: 2012-06-27

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!
Question by:bussd
    LVL 11

    Expert Comment

    what is Infragistics Listbar? a thirparty control?
    if so, is there a sample control which i can download and check out?

    Author Comment

    Hi Vo1d,

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

    I haven't used the trial so I'm not sure how it's limited but hopefully it's functional enough to help.
    LVL 11

    Expert Comment

    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.

    Author Comment

    I'm also using 2.0

    LVL 11

    Accepted Solution

    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

    Author Comment

    Wow.  Impressively quick and useful solution.  Thank you!

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    WiX Installer 2 38
    Get the last inserted ID 11 55
    custome paging in C# & oracle using inline queries. 12 29
    report c# 9 56
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now