title: How to make Transparent Web-browser control
body: <p>I have a system windows forms where i show the web browser control over the media-player control as shown in image below,
      <img src="https://i.stack.imgur.com/DyuTO.jpg" alt="enter image description here"></p>
  
  <p>I want to make <strong>Transparent web browser control</strong>. I have try many things but i am not able to make transparency over web  browser control, i have try :</p>
  
  <pre><code>this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
              this.BackColor = Color.FromArgb(0, 0, 0, 0);
              this.TransparencyKey = Color.Red;
              this.BackColor = Color.Magenta;
              this.TransparencyKey = Color.Magenta;*/
              SetStyle(ControlStyles.SupportsTransparentBackColor, true);
              this.BackColor = Color.Transparent; 
  </code></pre>
  
  <p>My code is :</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using Microsoft.DirectX.AudioVideoPlayback;
  using System.Windows.Forms;
  
  namespace Windows_Video
  {
      public partial class Form1 : Form
      {
          Video vdo;
  
          public string mode = "play";
          public string PlayingPosition, Duration;
  
          public Form1()
          {
  
              InitializeComponent();
            //  VolumeTrackBar.Value = 4;
  
          }
          private void Form1_Load(object sender, EventArgs e)
          {
              OpenFileDialog openFileDialog1 = new OpenFileDialog();
              if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
              {
                  this.textBox1.Text = openFileDialog1.FileName;
              }
              axWindowsMediaPlayer1.URL = textBox1.Text;
              axWindowsMediaPlayer1.Ctlcontrols.play();
  
          }
      private void button1_Click(object sender, EventArgs e)
          {
           /*   OpenFileDialog openFileDialog1 = new OpenFileDialog();
              if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
              {
                  this.textBox1.Text = openFileDialog1.FileName;
              }*/
          }    
  
          private void button2_Click(object sender, EventArgs e)
          {
  
          //    axWindowsMediaPlayer1.URL = textBox1.Text;
           //   axWindowsMediaPlayer1.Ctlcontrols.play();
          }
  
          private void button3_Click(object sender, EventArgs e)
          {
  
          }
  
          private void textBox1_TextChanged(object sender, EventArgs e)
          {
  
          }
  
          private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
          {
              //this.BackColor = System.Drawing.Color.Transparent;
              this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
              this.BackColor = Color.Transparent;
          } 
      }    
  }
  </code></pre>