Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
458
Transparent UltraLabel not really transparent over pictures
posted

I have several places in our application where I need to lay UltraLabels over a picture(UltraPictureBox).  However, even though the background of the UltraLabel is transparent, it does not draw the picture underneath it in the area of the UltraLabel.  It just draws the background color of the control underneath it but not the picture. Is there something I may be doing wrong, or is this a limitation of Infragistics or .NET?

 

Thanks,

Bill

  • 17259
    Offline posted

    Try this:

    Create a CustomControl that inherits UltrLabel.

    Add this code inside your CustonControl:

    protected override CreateParams CreateParams

    {

       get

       {

          CreateParams cp = base.CreateParams;

          cp.ExStyle |= 0x20; // WS_EX_TRANSPARENT

          return cp;

       }

    }

  • 37774
    Verified Answer
    posted

    The way that .NET transparency works is that a transparent control's region is painted by its parent, so in your case if the label is not a child control of the UltraPictureBox (which I don't think is possible), this will not work.  You could try setting the BackgroundImage property of a .NET Panel instead and put the label inside of that panel.

    -Matt