您好我想制作全屏透明且可点击的表单应用程序,但它会显示文本。如果有方法在屏幕顶部显示文字(如果有更多应用程序打开),我甚至不需要表格enter image description here
喜欢这样。
感谢。
答案 0 :(得分:1)
使用此示例代码:
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var F = new Form
{
BackColor = Color.Black,
TransparencyKey = Color.Black,
Bounds = Screen.PrimaryScreen.Bounds,
FormBorderStyle = FormBorderStyle.None,
};
var L = new Label
{
AutoSize = false,
Text="Hello, World!",
Dock = DockStyle.Fill,
ForeColor = Color.White,
Font = new Font("Consolas", 26),
TextAlign = ContentAlignment.MiddleCenter
};
F.Controls.Add(L);
Application.Run(F);
}
}
}