I am using Delphi 3, and I have a project that has a Main form and a Sub form. The Main form has a button, which displays (ShowModal) the second form.
What I would like is for the main form to disappear when the sub form opens. The following appears to do just that successfully...
Form2 := TForm2.Create(Application);
Form1.Visible := False;
The problem comes when Form2 is minimized via the title bar. What happens is that Form2 becomes a minimized rectangular bar, and hovers over top of the Win98 taskbar rather than melding with the initial taskbar button for the application. In other words, when Form1 appears, a taskbar button is placed on the Win98 taskbar. When Form2 is displayed, Form1 disappears...so far, so good. But when I minimize Form2, I know have the original taskbar button for the application, PLUS I have a minimized title bar on top of the Win98 taskbar (BAD).
How can I make the Form2 disappear, and keep the original taskbar button for the application? Then to restore Form2, all I'd have to do is click on associated task button on the Win98 taskbar.