Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None Me.KeyPreview = True Me.Opacity = 0.5 Me.BackColor = Color.Black Me.Size = New Size(300, 50) End Sub Private mousePoint As Point Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown If (e.Button And MouseButtons.Left) = MouseButtons.Left Then mousePoint = New Point(e.X, e.Y) End If End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove If (e.Button And MouseButtons.Left) = MouseButtons.Left Then Me.Left += e.X - mousePoint.X Me.Top += e.Y - mousePoint.Y End If End Sub Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown Debug.WriteLine(e.KeyCode) Select Case e.KeyCode.ToString Case "P" Dim g As Graphics = Me.CreateGraphics() Dim fnt As New Font("MS UI Gothic", 20) g.DrawString("これはテストです。", fnt, Brushes.White, 10, 10) '←この文字は不透明にしたい fnt.Dispose() g.Dispose() Case "Escape" Me.Close() Case Else End Select End Sub End Class