Вот моя прога, 2 года назад писал и не потерял)) Тут по нажатию на форму рисуется паутина как бы центр там куда ты нажала. Вообщем думаю разберешься, если что - пиши.
Public Class Form1 Dim x, y As Integer Sub pau(ByVal gr As Graphics, ByVal x As Integer, ByVal y As Integer) Dim i, w, h As Integer gr.Clear(Color.White) w = ClientRectangle.Width / 2 h = ClientRectangle.Height / 2 For i = 0 To 2 gr.DrawLine(Pens.BurlyWood, New Point(w * i, 0), New Point(x, y)) gr.DrawLine(Pens.BurlyWood, New Point(w * i, h * 2), New Point(x, y))
Next gr.DrawLine(Pens.BurlyWood, New Point(0, h), New Point(x, y)) gr.DrawLine(Pens.BurlyWood, New Point(w * 2, h), New Point(x, y)) End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp Dim gr As Graphics = Me.CreateGraphics
x = e.X y = e.Y pau(gr, x, y) End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim gr As Graphics = e.Graphics pau(gr, x, y) End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load x = 100 y = 230 End Sub End Class
Вот моя прога, 2 года назад писал и не потерял)) Тут по нажатию на форму рисуется паутина как бы центр там куда ты нажала. Вообщем думаю разберешься, если что - пиши.
Public Class Form1
Dim x, y As Integer
Sub pau(ByVal gr As Graphics, ByVal x As Integer, ByVal y As Integer)
Dim i, w, h As Integer
gr.Clear(Color.White)
w = ClientRectangle.Width / 2
h = ClientRectangle.Height / 2
For i = 0 To 2
gr.DrawLine(Pens.BurlyWood, New Point(w * i, 0), New Point(x, y))
gr.DrawLine(Pens.BurlyWood, New Point(w * i, h * 2), New Point(x, y))
Next
gr.DrawLine(Pens.BurlyWood, New Point(0, h), New Point(x, y))
gr.DrawLine(Pens.BurlyWood, New Point(w * 2, h), New Point(x, y))
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
Dim gr As Graphics = Me.CreateGraphics
x = e.X
y = e.Y
pau(gr, x, y)
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim gr As Graphics = e.Graphics
pau(gr, x, y)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
x = 100
y = 230
End Sub
End Class