Link to home
Start Free TrialLog in
Avatar of jianl
jianl

asked on

How can I show many windows in one background?

Hi:
  I come form China.I get something trouble in Delphi 1 :-!
In my application,the main window is no title and show a bitmap in it,some other small bitmap on it to get mouse message to show some windows. The trouble is: if I use showmodal,it will be only one windows on background.if show,when mouse click the background,the showed windows will be under the backgroud.
How can I show many window in the backgroud?
Avatar of Marcius
Marcius

I am not sure exactly what you are trying to do here, but try to set the FormStyle property of the new windows to fsStayOnTop. This should prevent them from disappearing when you click on the background (parent form).

Marcius:
   Thanks! but I want show more then one windows.
d003303:
   I've try to use MDI forms, but in MDI Main form
the bitmap will be not visibled.

Avatar of jianl

ASKER

If you want to use multiple form of the same type, but don't want to use MDI, you will have to create the forms at runtime.

Remove the child form from the Project|Options|Autocreate forms list. Then, each time you want a new form to appear:

procedure MyApp.OnBitmapClick;
begin
  with MyForm1.Create(self) do begin

    //Set your parameters here
    FormStyle := fsStayonTop;
    Show;

  end;
end;

Each time you click on your bitmap, you will dynamically create a new form. This should allow you to have multiple forms without using the MDI. However, you need to make sure that you destroy all the forms when you exit your application. Otherwise you will waste memory.
ASKER CERTIFIED SOLUTION
Avatar of Marcius
Marcius

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial