I have been working on this code:
Private Sub ABToolStripMenuItem_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles ABToolStripMenuItem.Paint
Dim var As System.Drawing.Graphics
var = Me.CreateGraphics
Dim pen1 As Pen
pen1 = New Pen(Color.Black, 1)
'Horizontal line
'1st moves the line further in, towards the middle.
'2nd And 4th must be the same number And they bring the line down
'3rd Is the length of the line
'var.DrawLine(pen1, 50, 90, 600, 90)
var.DrawLine(pen1, 50, 200, 600, 200)
var.DrawLine(pen1, 50, 230, 600, 230)
'Vertical line
'1st And 3rd numbers must be the same number to keep the line straight
'2nd move the position of the line inward
'4th Is the vertical length
var.DrawLine(pen1, 50, 200, 50, 1000)
End Sub
I want to set it up where I click on the AB menu item then it populates, problem is that it populates on the form before I click anything. I just highlight the menu item and it automatically draws the lines. I would like to set it up to paint on menu item click.
Side note, I also have an event that adds labels based on ABmenuitemclick. The problem is when I add both together the lines do not show up at all. Reading forums I have to have an event that is specifically made to paint the lines. So that is why I separated the code.
What I have tried:
Tried switching to a .click event, but the program crashes from doing a paint eventargs with a click.