Penny hapeny
2008-03-20 14:44:46 UTC
Hi All,
I hope some of you can help me.
I am experimenting with the canvas runtime Properties.
I have a Main Form with two buttons on it. In the code for the Button1Click
I have a few Canvas calls IE
Canvas->MoveTo(5,5);
Canvas->LineTo(20,80);
Canvas->MoveTo(100,400);
Canvas->LineTo(100,600);
Canvas->Pen->Color = clRed;
Canvas->MoveTo(200,100);
Canvas->Ellipse(70,80,200,400);
All Ok. The second button,
Button2Click opens a second Form as follows
SecondForm->Show();
MainForm->Refresh();
MainForm->Update();
The second Form has a button on it and Code in its Unit.cpp file as follows
ReturnMainFormClick(TObject *Sender)
{
ReturnMainForm;
Close();
}
This returns to the first form and closes the second.
The first form is then displayed with the buttons Ok,
but not with the lines and Ellipse that were generated by the first button,
and before transfering to the Second Form.
If one clicks the button1 again then they are shown.
But what I want is to be able to return to the FirstForm with its
drawings intact as they were when I left it.
The refresh() and Update() don't seem to have any effect, I added them
more in hope rather than being sure what I was doing.
Thanks in advance
Penny.
I hope some of you can help me.
I am experimenting with the canvas runtime Properties.
I have a Main Form with two buttons on it. In the code for the Button1Click
I have a few Canvas calls IE
Canvas->MoveTo(5,5);
Canvas->LineTo(20,80);
Canvas->MoveTo(100,400);
Canvas->LineTo(100,600);
Canvas->Pen->Color = clRed;
Canvas->MoveTo(200,100);
Canvas->Ellipse(70,80,200,400);
All Ok. The second button,
Button2Click opens a second Form as follows
SecondForm->Show();
MainForm->Refresh();
MainForm->Update();
The second Form has a button on it and Code in its Unit.cpp file as follows
ReturnMainFormClick(TObject *Sender)
{
ReturnMainForm;
Close();
}
This returns to the first form and closes the second.
The first form is then displayed with the buttons Ok,
but not with the lines and Ellipse that were generated by the first button,
and before transfering to the Second Form.
If one clicks the button1 again then they are shown.
But what I want is to be able to return to the FirstForm with its
drawings intact as they were when I left it.
The refresh() and Update() don't seem to have any effect, I added them
more in hope rather than being sure what I was doing.
Thanks in advance
Penny.