Aiysha
asked on
Sensitive picture display on the form.
The picture on the form draws a graph, but the picture is so sensitive, it disappears if a windows comes on top of it, it also dissappears if the application window is minimized, can someone please tell me what is causing this behavior.
Thank you.
Thank you.
How are you drawing this graph?
ASKER
For j = 1 To count - 1
X = ArrDate(j)
Y = ArrData(j)
x1 = ArrDate(j + 1)
y1 = ArrData(j + 1)
Picture1.Line (X, Y)-(x1, y1), vbBlue
Picture1.DrawWidth = 2
Next j
X = ArrDate(j)
Y = ArrData(j)
x1 = ArrDate(j + 1)
y1 = ArrData(j + 1)
Picture1.Line (X, Y)-(x1, y1), vbBlue
Picture1.DrawWidth = 2
Next j
do you have form.redraw set to false if so then set it to true and see if this helps.
ASKER
Where do I find that option "Form.redraw" ?
It should be the AutoRedraw property of your PICTUREBOX set to True.
If you don't want AutoRedraw set to True, then use the PictureBoxes Paint() event to do your drawing:
So either:
Private Sub Form_Load()
Picture1.AutoRedraw = True
End Sub
or:
Private Sub Picture1_Paint()
' variable declarations...
' ... more code possibly ...
For j = 1 To Count - 1
X = ArrDate(j)
Y = ArrData(j)
X1 = ArrDate(j + 1)
Y1 = ArrData(j + 1)
Picture1.Line (X, Y)-(X1, Y1), vbBlue
Picture1.DrawWidth = 2
Next j
End Sub
If you don't want AutoRedraw set to True, then use the PictureBoxes Paint() event to do your drawing:
So either:
Private Sub Form_Load()
Picture1.AutoRedraw = True
End Sub
or:
Private Sub Picture1_Paint()
' variable declarations...
' ... more code possibly ...
For j = 1 To Count - 1
X = ArrDate(j)
Y = ArrData(j)
X1 = ArrDate(j + 1)
Y1 = ArrData(j + 1)
Picture1.Line (X, Y)-(X1, Y1), vbBlue
Picture1.DrawWidth = 2
Next j
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.