I'm trying to make a drawing on one of the forms I'm working on which requires a bunch of lines. I had an idea to use the MouseDown Sub to determine the coordinates of the lines I want to draw, and then to post the results in the Immediate Window. Here's what I have so far:
But I find that it isnt printing. I know that I can simply pop the text into another form's text box or label, but I'd much rather use not make an additional form nor add any more controls to the current form.VB Code:
Private xco1 As Integer = 0 Private xco2 As Integer = 0 Private yco1 As Integer = 0 Private yco2 As Integer = 0 Private xy As Integer = 1 Private line As String Private Sub frmButton_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown If xy = 1 Then xco1 = e.X yco1 = e.Y xy = 2 Else xco2 = e.X yco2 = e.X xy = 1 line = "(" & CStr(xco1) & ", " & CStr(yco1) & "), (" & CStr(xco2) & ", " & CStr(yco2) & ");" Console.WriteLine(line) End If End Sub
Any ideas?




Reply With Quote