DocumentTabStrip Close Button hovered image

2 posts, 0 answers
  1. Ian
    Ian avatar
    61 posts
    Member since:
    Jul 2010

    Posted 13 Dec 2011 Link to this post

    Hi Telerik

    I want to replace the image displayed when ShowCloseButton is active on a document tabstripitem while maintaining its hover and pressed image behaviour.

    I create the dodument window at run time and I can get the image to change to a static image using the following line

                document.TabStripItem.CloseButton.Image = Resources.GreenTickNormal22;

    where "document" is typeof(DocumentWindow)

    I also have added the following lines to get the image to change but these lines don't seem to be working

                document.TabStripItem.CloseButton.ImageHovered = Resources.GreenTickHover22;;
                document.TabStripItem.CloseButton.ImageClicked = Resources.GreenTickClick22;

    Am I missing and event somewhere which needs to be raised?

    Ian Carson
  2. Stefan
    Stefan avatar
    2911 posts

    Posted 16 Dec 2011 Link to this post

    Hi Ian,

    Thank you for writing.

    Indeed, there seems to be an issue with the ImageHovered and ImageClciked properties of RadImageButtonElement. I have logged this issue into our PITS system and we will address it in a future release. Here is a link to the item, where you can add your vote for it. 

    Meanwhile, you can use the following approach to achieve the desired appearance:
    Image saveOriginalImage;
    private void radButton1_Click(object sender, EventArgs e)
        DocumentWindow document = new DocumentWindow();
        saveOriginalImage = document.TabStripItem.CloseButton.Image;
        document.TabStripItem.ShowCloseButton = true;
        document.TabStripItem.CloseButton.Image =;
        document.TabStripItem.CloseButton.MouseMove += new MouseEventHandler(CloseButton_MouseMove);
        document.TabStripItem.CloseButton.MouseLeave += new EventHandler(CloseButton_MouseLeave);
      //  document.TabStripItem.CloseButton.ImageHovered = saveOriginalImage;
      //  document.TabStripItem.CloseButton.ImageClicked = saveOriginalImage;
    void CloseButton_MouseMove(object sender, MouseEventArgs e)
        RadImageButtonElement b = sender as RadImageButtonElement;
        b.Image = saveOriginalImage;
    void CloseButton_MouseLeave(object sender, EventArgs e)
        RadImageButtonElement b = sender as RadImageButtonElement;
        b.Image =;       

    I hope that you find this information helpful. Should you have any other questions or suggestions, do not hesitate to contact us.

    Kind regards,
    the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top