概要
cscの作法、調べてみた。
オーバーレイフォームを見つけたので、やってみた。
参考にしたページ。
写真
サンプルコード
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace App
{
public partial class Form1: Form {
Button button1;
public Form1() {
Text = "overlay";
ClientSize = new Size(300, 200);
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
TransparencyKey = BackColor;
Opacity = 0.7;
StartPosition = FormStartPosition.Manual;
Location = new Point(0, 0);
TopMost = true;
button1 = new Button();
button1.Location = new Point(20, 20);
button1.Text = "make";
button1.Click += new EventHandler(button1_Click);
Controls.AddRange(new Control[] {
button1
});
}
protected override CreateParams CreateParams {
get {
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x00000020;
return cp;
}
}
private void button1_Click(object sender, EventArgs e) {
MessageBox.Show("ok");
}
[STAThread]
public static void Main() {
Application.Run(new Form1());
}
}
}
以上。