110,539
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AddTransparentPanel
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.button1.Enabled = false;
Transparent userControl = new Transparent();
this.Controls.Add(userControl);
userControl.Dock = DockStyle.Fill;
userControl.BringToFront();
for (int i = 0; i < 10; i++)
{
System.Threading.Thread.Sleep(300);
}
this.Controls.Remove(userControl);
userControl.Dispose();
userControl = null;
this.button1.Enabled = true;
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("test");
}
}
}