Any trick to use opacity on a panel in Visual Studio Window Form?

前端 未结 3 918
悲&欢浪女
悲&欢浪女 2020-11-29 06:47

I recently started exploring Visual Studio. I was trying to create a slide menu. More specifically, when the user would press the button a submenu would pop up to the right.

3条回答
  •  渐次进展
    2020-11-29 07:44

    Set any color at the panel. For example, black, after which you just need to register the TransparencyKey shape and select the color you want to make transparent:

     public Form1()
            {
                InitializeComponent();
                panel1.BackColor = Color.Black; 
                this.TransparencyKey = Color.Black;
            }
    

提交回复
热议问题