如何利用VB.net 在桌面中标示十字线条
小弟目前知道在picture控键中或是form对象中 划出十字线条的
代码 可是如果要在桌面去表现出十字线条的话 要怎么做到呢?
以下是实时在picture 控键 绘出十字线条的代码:
Public Class Form1
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
PictureBox1.Invalidate()
End Sub
Private Sub PictureBox_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim point As Point = PointToClient(MousePosition)
Dim x As Integer = point.X
Dim y As Integer = point.Y
With e.Graphics
.DrawLine(Pens.Black, 0, 65, PictureBox1.Width, 65)
.DrawLine(Pens.Black, x, 0, x, PictureBox1.Height)
End With
End Sub
End Class