vb.net 的screen的mousedown ,mousemove,mouseup事件
我晕,楼下说的我都会,关键是要用鼠标截屏,要是设置好数值,一下子就出来,那也太2了 展开
问题:引用原文:“要是换个思路,先截全屏,然后将窗体全屏,让Picturebox占满全屏幕,但是无论利用什么方法(最大化,boderstyle设为none)都遮挡不了任务栏。”
解决方法:经测试,代码可以实现你得要求,即能遮挡任务栏。
设置:在窗体上添加一个PictureBox1,,dock属性设置为Fill。随便导入一张图片用于显示。
代码如下:
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.WindowState = FormWindowState.Maximized
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Me.Close()
End Sub
End Class
程序截图:
Dim MyGraphics As Graphics = Me.CreateGraphics()
Dim S As Size = Me.Size
MemoryImage = New Bitmap(S.Width, S.Height, MyGraphics)
Dim MemoryGraphics As Graphics = Graphics.FromImage(MemoryImage)
MemoryGraphics.CopyFromScreen(Me.Location.X, Me.Location.Y, 0, 0, S) '可以事先定义你截屏的坐标,在这里做更改
End Sub