Author Topic: Basic Label Tranperancy?  (Read 561 times)

rbeavers

  • Newbie
  • *
  • Posts: 19
    • View Profile
Basic Label Tranperancy?
« on: January 07, 2017, 05:49:49 PM »
Hello,
   I would like to place a Basic Label over each  StackLight Color. When the light is on, the Basic Label is visible and vice versa. I would like the basic Label background to be transparent when the label is visible. When I set the Basic Label Background Color to transparent, the background is still solid? Any way to get a Transparent Background on a Basic Label?

Thanks,
-Rob

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Basic Label Tranperancy?
« Reply #1 on: January 07, 2017, 06:00:59 PM »
Winforms doesn't like stacked controls very well. A work around would be to modify the code to make the stack light control paint the text. If you open StackLight.vb and add code like this:

   Protected Overrides Sub OnPaint(e As PaintEventArgs)
        MyBase.OnPaint(e)
        e.Graphics.DrawString("Text1", Font, New SolidBrush(ForeColor), New Point(0, 0))
    End Sub