DockPanel.Image Transparency Color

5 posts, 1 answers
  1. Phi
    Phi avatar
    47 posts
    Member since:
    Dec 2008

    Posted 03 Dec 2008 Link to this post

    I have a ShapedForm with about 8 DockPanels. I assigned images to all of them. The images look great in design mode. However, at runtime, the white background color on some of the images still showed. I could not find a way to set the Transparency color for them!

    Phi
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 05 Dec 2008 Link to this post

    Hello Phi,

    You can use the DefaultPresenter property of the DockPanel and cast it to the DockPresenterControl. Then change its Color or BackgroundImage. Keep in mind that when making some dock/redock/autohide operations the presenter may be created again.
     

    Greetings,
    Julian Benkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Phi
    Phi avatar
    47 posts
    Member since:
    Dec 2008

    Posted 06 Dec 2008 Link to this post

    Sorry I did not make it very clear about my problem. I was talking about the little image/icon that showed up on the DockPanel's tabstrip.

    Is there a way to control the transparency color, image location, ect for the tabstrip of the DockPanel?

    Thanks,

    Phi
  5. Answer
    Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 09 Dec 2008 Link to this post

    Hello Phi,

    You can access and use the DockableTab property of the DockPanel object.

    this.dockPanel1.DockableTab.Image 

    The DockableTab inherits from TabItem, where you can change other image-related properties.

    Regards,
    Julian Benkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Phi
    Phi avatar
    47 posts
    Member since:
    Dec 2008

    Posted 09 Dec 2008 Link to this post

    I was hoping to be able to access this via the Designer but this would do as well.

    In case someone else may have similar problem, here is the code I am using:

                if (this.dockPanel.DockableTab != null)
                    this.dockPanel.DockableTab.ImagePrimitive.TransparentColor = System.Drawing.Color.White;

    Thanks,

    Phi
Back to Top
UI for WinForms is Visual Studio 2017 Ready