22-degrees
Well-known member
Hi all, my latest project has me adding a line graph feature to a form.
I use the following to draw:
The lines are all drawing correctly and i have set a feature that allows the user to highlight/enhance specific graph lines by selecting the line owner from a listbox. This sets the pen.width to double the default and redraws that line. This option allows multiple lines to be highlighted on the graph for better analysis.
What I would like to be able to do next is give the user the option of selecting one of those line-owners from the listbox again in order to get the effect of resetting that line to its default width. (Un-highlight / un-enhance). Is there a way to directly "un-draw" a line or am I going to have to go around it the long way and log each and every highlighted line and do a complete re-draw if user de-selects a line-owner???
PS: This is my first time drawing on a form so be gentle if the answer is looking me in the face
I use the following to draw:
VB.NET:
Dim myPen As New System.Drawing.Pen(col(a))
Dim formGraphics As System.Drawing.Graphics
x = ************
y = **************
x2 = ***********
y2 = ***********
formGraphics = Me.CreateGraphics()
formGraphics.DrawLine(myPen, x, y, x2, y2)
The lines are all drawing correctly and i have set a feature that allows the user to highlight/enhance specific graph lines by selecting the line owner from a listbox. This sets the pen.width to double the default and redraws that line. This option allows multiple lines to be highlighted on the graph for better analysis.
What I would like to be able to do next is give the user the option of selecting one of those line-owners from the listbox again in order to get the effect of resetting that line to its default width. (Un-highlight / un-enhance). Is there a way to directly "un-draw" a line or am I going to have to go around it the long way and log each and every highlighted line and do a complete re-draw if user de-selects a line-owner???
PS: This is my first time drawing on a form so be gentle if the answer is looking me in the face