0

I use a 3rd party control (a video player), for some unknown reason, most of the event doesn't work(double click, etc)

So I want to put one control on the top of it. In this way, I can handle the event of the transparent control rather than the 3rd party control.

I tested Label, PictureBox, and so on, but it didn't work.

label.background = Color.Transparent; 

The label is not transparent after set its bkground to transparent

zx485
  • 28,498
  • 28
  • 50
  • 59
camino
  • 10,085
  • 20
  • 64
  • 115
  • Any control with a *plain* surface can be turned into an *overlay*. [Here's a Panel](https://stackoverflow.com/a/51434828/7444103). And [another one](https://stackoverflow.com/a/54158350/7444103) with an Opacity property – Jimi Feb 11 '19 at 00:04
  • @Jimi Thanks. Can I add this custom control to toolbox? – camino Feb 11 '19 at 00:08
  • Sure. Paste everything inside a class, build the Project, and you'll find it there. – Jimi Feb 11 '19 at 00:09
  • The Panel in the first link doesn't have an empty contructor. You'll need to add one, if you want to have it in the ToolBox. – Jimi Feb 11 '19 at 00:18
  • @Jimi I can see OverlayPanel in toobox, when dragging it to the form, I got 'System.MissingMethodException: Constructor on type '.OverlayPanel' not found. – camino Feb 11 '19 at 00:21
  • 1
    As far as I known most WinForms controls do not directly support true transparency but are just able to adapt their background color to fit their parent background so they properly works only on plain background (of the specified color). – Phil1970 Feb 11 '19 at 02:11
  • 1
    Also in [this example](https://stackoverflow.com/a/40209045/3110834), I've used a transparent panel to draw sizable border around controls. Or this [panel](https://stackoverflow.com/a/32402532/3110834). But the most stable solution is a [form](https://stackoverflow.com/a/32783251/3110834). – Reza Aghaei Feb 11 '19 at 04:11

0 Answers0