悬浮穿透文字
private void Form1_Load(object sender, EventArgs e) { var transColor = Color.Red; this.BackColor = transColor; this.TransparencyKey = transColor; this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; this.TopMost = true; label1.BackColor = transColor; label1.Text = "这是悬浮穿透文字"; }
上方仍然有一个缺点,在Win7下点击任务栏或者开始按钮时仍然可能展示到后面去,可以加一个Timer来定时设置this.TopMost = true;