>Hi,
> I am facing one problem.
> On one of the form of my project, there are 5 tabs. On 1 tab, I am generating a graph by using Thisform.line() method. But when I move to other tabs and come back to that tab, the graph disappears. It happens also when I toggle between windows or minimize and restore the screen.
> Please tell me the reason and the solution.
Anything that you put on a form using .pSet(), .line(), .print() etc is just temporary. Any event that may cause the form to repaint will erase it. These methods are pretty much an emulation of the console - issuing .print() in a loop on a form would cause it to scroll
behind any controls you may have on it.
The way around this is to have a line object for each segment of your graph. So instead of .line(x1, y1, x2, y2), you'd have an
this.addobject("oLinennn","line")
with this.oLinennn
.left=x1
.top=y1
.width=x2-x1
.height=y2-y1
.slant=iif(..., "/", "\")
.visible=.t.
endwith
Actually, this conversion of two pairs of points into a line object may be a bit more complicated, as you can't have negative height, i.e. it may look different if your graph segment is ascending or descending. Also, the slope expression would depend on the same thing.