0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

cscの作法 その356

Last updated at Posted at 2023-06-10

概要

cscの作法、調べてみた。
オーバーレイフォームを見つけたので、やってみた。

参考にしたページ。

写真

image.png

サンプルコード



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());
		}
	}

}




以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?