I use the following code :
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.visible := false;
Form2.show;
end;
Yes, the form1 got hidden and the form2 show up. But why the application icon in the taskbar also got hidden....
I use the following codes and still can not show the icon on the taskbar, while hide the form1.
visible := false;
{
enable := false;
Application.MainFormOnTaskbar := True;
ShowWindow(Application.Handle, SW_SHOW);
SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
}
How to keep the application icon on the taskbar while I want to hide the form ?
I want to do it in the unit files , not the DPR file.
The Files that I want to do keep the system taskbar are at : http://sidhiciang.com/myfiles/ShowHideForms.rar
Unit1.pas
If Form1.btShowForm2Click() , then
Hide Form1 and Show Form2 ( actHideForm1execute(self)).
If Form1.btCloseForm1Click(), then
Close the application
Unit2.pas
If Form2.btShowForm3Click(), then
Hide Form2 and Show Form3 ( actHideForm2execute(self)).
If Form2.btCloseForm2Click(), then
Show the Form1 and Form2.close (actShowForm1execute(self))
Unit3.pas
If btCloseFrom3Click(), then
Show Form2 and Close Form3
In all of the Unit1 / Unit2 / Unit3, Keep the application icon on taskbar available. Because if I use .visible := false, the system taskbar also become hidden.
PS: I use Delphi 2010 and running on Windows XP and 7 Enviorment.