Hello, Trying to do this in c# but not sure this can be achieved. What I want is to have a windows media window as background, and have labels at front. However, the problem is that the label has background and it is not transparent. So I put a transparent label in: public class TransparentLabel : System.Windows.Forms.Label { protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT return cp; } } protected void InvalidateEx() { if (Parent == null) return; Rectangle rc = new Rectangle(this.Location, this.Size); Parent.Invalidate(rc, true); } protected override void OnPaintBackground(PaintEventArgs pevent) { //do not allow the background to be painted } } The problem is that when I put this control on top of the media player component, the label just dispears when the movie starts. So is there some way to work it out? Many Thanks Jerry
Hello Jerry, Did you try adding label on top of the WMP control and setting its backcolor to transparent [Web].and forecolor to white. Regards Sreejumon [MVP] "DAXU" wrote in message news:1910ca66-553b-4859-b342-5100394e3b3c@w7g2000hsa.googlegroups.com... > Hello, > Trying to do this in c# but not sure this can be achieved. What I want > is to have a windows media window as background, and have labels at > front. > However, the problem is that the label has background and it is not > transparent. So I put a transparent label in: > public class TransparentLabel : System.Windows.Forms.Label > { > protected override CreateParams CreateParams > { > > get > { > > CreateParams cp = base.CreateParams; > > cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT > > return cp; > > } > > } > protected void InvalidateEx() > { > > if (Parent == null) > > return; > > Rectangle rc = new Rectangle(this.Location, this.Size); > > Parent.Invalidate(rc, true); > > } > protected override void OnPaintBackground(PaintEventArgs > pevent) > { > > //do not allow the background to be painted > > } > > } > > The problem is that when I put this control on top of the media player > component, the label just dispears when the movie starts. > > So is there some way to work it out? > > Many Thanks > > Jerry
From: "DAXU" [...] > The problem is that when I put this control on top of the > media player component, the label just dispears when the > movie starts. I can not guarantee that the following will work, but you can try: set WMP as windowless then put all of your GUI elements into another window, make it transparent and put it on top of the WMP area. -- // Alessandro Angeli // MVP :: DirectShow / MediaFoundation // mvpnews at riseoftheants dot com // http://www.riseoftheants.com/mmx/faq.htm