Form without Titlebar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34376
    ScottCannon
    Participant

    Is it possible to create a skinned form and remove the title bar from the form?

    I've only be able to accomplish this with the form skinning turned off (form.tag = -98) and then the borders are not skinned and the extended borders are removed too.

    #44977
    Support
    Keymaster

    Hello

    You want to have unskinned borders and title of form? Or you want to remove them?

    You can use sSkinProvider.DrawNonClientArea in first case or Form1.BorderStyle := bsNone in second case.

    #44979
    ScottCannon
    Participant

    I want a skinned (Sizeable) borders and no titlebar. A normal window that is sizeable and has extended borders but does not have a titlebar.

    You can do this with AlphaSkins turned off using the the following code. If you turn on AlphaSkins it paints the titlebar and does not work correctly.

    procedure TForm1.btnShowTitlebarClick(Sender: TObject);

    var

    Style: Longint;

    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;

    procedure TForm1.btnShowTitlebarClick(Sender: TObject);

    var

    Style: Longint;

    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 or WS_CAPTION or

    WS_BORDER);

    bsDialog: SetWindowLong(Handle, GWL_STYLE,

    Style or WS_CAPTION or DS_MODALFRAME or WS_DLGFRAME);

    end;

    Height := Height + GetSystemMetrics(SM_CYCAPTION);

    Refresh;

    end;

    end;

    #45010
    Support
    Keymaster

    Hello

    Skinned borders are not drawn now if caption is not visible.

    I think, this behaviour must be changed and I will be thinking how to do that.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.