Entwickler-Ecke

Grafische Benutzeroberflächen (VCL & FireMonkey) - MDI Child "ohne" Border?


Zimond - Do 06.05.04 17:09
Titel: MDI Child "ohne" Border?
Die Delphi Hilfe sagt zwar geht nich aber gib es trotzdem eine möglichkeit ein MDIChild Formular ohne Rand zu erstellen?


galagher - Sa 08.05.04 17:41
Titel: Re: MDI Child "ohne" Border?
Zimond hat folgendes geschrieben:
Die Delphi Hilfe sagt zwar geht nich aber gib es trotzdem eine möglichkeit ein MDIChild Formular ohne Rand zu erstellen?


Hallo! Hoffe, du kannst das noch gebrauchen! Damit hast du zwar immer noch einen ganz schmalen Rahmen, aber keine Titelleiste. Was Besseres habe ich leider nicht! (Form2 ist hier das MDIChild).


Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
procedure TForm2.FormCreate(Sender: TObject);
begin
 BorderStyle := bsSingle;
 HideTitlebar(Form2);
end;

{Titelzeile nicht sichtbar}
procedure HideTitlebar(Form: TForm);
var 
  Style: Longint; 
begin
 with Form do
 begin
  if BorderStyle = bsNone then Exit;
  Style := GetWindowLong(Handle, GWL_STYLE);
  if (Style and WS_CAPTION) = WS_CAPTION then
  begin
   case BorderStyle of
     bsSingle,
     bsSizeable: SetWindowLong(Handle, GWL_STYLE, Style and
         (not (WS_CAPTION)) or WS_BORDER);
     bsDialog: SetWindowLong(Handle, GWL_STYLE, Style and
         (not (WS_CAPTION)) or DS_MODALFRAME or WS_DLGFRAME);
   end;
   Height := Height - GetSystemMetrics(SM_CYCAPTION);
   Refresh;
  end;
 end
end;