Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Dim cr = Me.ClientRectangle Dim r = Me.RectangleToScreen(cr) Dim bmp As New Bitmap(cr.Width, cr.Height) Using g = Graphics.FromImage(bmp) '画面キャプチャ g.CopyFromScreen(r.Location, New Point(0, 0), r.Size) '半透明のスモークをかける Using b As New SolidBrush(Color.FromArgb(180, Color.DarkGray)) g.FillRectangle(b, cr) End Using End Using
Dim Pnl As New Panel Pnl.Parent = Me
'Panel1を重ねて表示 Dim oldBmp = Pnl.BackgroundImage Pnl.BackgroundImage = bmp If oldBmp IsNot Nothing Then oldBmp.Dispose() Pnl.BringToFront() Pnl.SetBounds(cr.X, cr.Y, cr.Width, cr.Height) Pnl.Visible = True Form4.ShowDialog(Me) Pnl.Visible = False Pnl.Dispose() End Sub