| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
How to return to previous form(not main) ?
i'm quite new to delphi and theres something about its form i don't quite get it yet, i hope someone will be able to help me out. I'll put it with a simple example :
1. have 3 forms with a button each. Only the first form is auto created. 2. 1st form (main) will show 2nd form, and the 2nd form will show the 3rd. 3. 3rd form will need to return to middle form, that's when i get access violation error. ------------------- [code] //main form will contain : procedure TfrmMain.Button1Click(Sender: TObject); var f:TfrmSecond; begin f := TfrmSecond.Create(nil); try f.ShowModal; finally f.Release; end; end; //second form also contains : var f:TfrmThird; begin f := TfrmThird.Create(nil); try f.ShowModal; finally f.Release; end; end; //third form contains : procedure TfrmThird.Button1Click(Sender: TObject); var f:TfrmSecond; begin try f.ShowModal; finally f.Release; end; end; [\code] |
|
#2
|
|||
|
|||
|
As you're showing each form modally - You actually don't need any code in the third form (except mabe a close button).
When you close the third form your code will resume from the next line after the ShowModal line (in the second form) - and so on for the second and first forms. |
![]() |
| Viewing: Tutorialized Forums > Desktop Programming > Delphi > How to return to previous form(not main) ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|