Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > DocumentTabStrip Close Button hovered image

Not answered DocumentTabStrip Close Button hovered image

Feed from this thread
  • Ian avatar

    Posted on Dec 13, 2011 (permalink)

    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?

    Regards
    Ian Carson

    Reply

  • Stefan Stefan admin's avatar

    Posted on Dec 16, 2011 (permalink)

    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();
        radDock1.AddDocument(document);
        saveOriginalImage = document.TabStripItem.CloseButton.Image;
        document.TabStripItem.ShowCloseButton = true;
        document.TabStripItem.CloseButton.Image = Resources.help;
     
        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 = Resources.help;       
    }

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

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > DocumentTabStrip Close Button hovered image
Related resources for "DocumentTabStrip Close Button hovered image"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]