Author: Jonas Bilinkevicius
I want the form only to appear once on the user's desktop regardless of whether it
has focus or not.
Answer:
Solve 1:
1 type2 TForm2 = class(TForm)
3 {other stuff above}4 procedure CreateParams(var Params: TCreateParams); override;
5 {other stuff below}6 end;
7 8 procedure TForm2.CreateParams(var Params: TCreateParams);
9 begin10 inherited CreateParams(Params);
11 Params.Style := Params.Style andnot WS_OVERLAPPEDWINDOW or WS_BORDER
12 end;
Solve 2:
For a MDI child form, setting the BorderStyle to bsNone does not remove the title
bar. This does it:
13 14 procedure tMdiChildForm.CreateParams(var Params: TCreateParams);
15 begin16 inherited CreateParams(Params);
17 Params.Style := Params.Style and (not WS_CAPTION);
18 end;