Delphi 11 Alexandria の Windows 10 で 32 ビット VCL アプリケーションを実行すると、最初は正常に見えます (メインメニューが非表示になっていることを除く)。
しかし、ウィンドウがフォーカスを失うとすぐに、TTitleBarPanel
OVERLAPS pnlHeaderTPanel
( a内にネストされたTCard
):
しかし、ドキュメンテーションが言うように、私はやったTTitleBarPanel
.
この重複をどのように回避できますか?
ユニットは次のとおりです。
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Menus,
Vcl.TitleBarCtrls, Vcl.WinXPanels;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
menuitemOptions: TMenuItem;
menuitemPreferences: TMenuItem;
menuitemAbout: TMenuItem;
pnlHeader: TPanel;
TitleBarPanel1: TTitleBarPanel;
CardPanel1: TCardPanel;
Card1: TCard;
Panel1: TPanel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
そして、ここにフォームがあります:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 294
ClientWidth = 515
Color = clSilver
CustomTitleBar.Control = TitleBarPanel1
CustomTitleBar.Enabled = True
CustomTitleBar.Height = 34
CustomTitleBar.BackgroundColor = clWhite
CustomTitleBar.ForegroundColor = 65793
CustomTitleBar.InactiveBackgroundColor = clWhite
CustomTitleBar.InactiveForegroundColor = 10066329
CustomTitleBar.ButtonForegroundColor = 65793
CustomTitleBar.ButtonBackgroundColor = clWhite
CustomTitleBar.ButtonHoverForegroundColor = 65793
CustomTitleBar.ButtonHoverBackgroundColor = 16053492
CustomTitleBar.ButtonPressedForegroundColor = 65793
CustomTitleBar.ButtonPressedBackgroundColor = 15395562
CustomTitleBar.ButtonInactiveForegroundColor = 10066329
CustomTitleBar.ButtonInactiveBackgroundColor = clWhite
DoubleBuffered = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []
GlassFrame.Enabled = True
GlassFrame.Top = 34
Menu = MainMenu1
Position = poScreenCenter
StyleElements = [seFont, seClient]
PixelsPerInch = 96
TextHeight = 15
object TitleBarPanel1: TTitleBarPanel
Left = 0
Top = 0
Width = 515
Height = 34
CustomButtons = <>
ExplicitWidth = 608
end
object Panel1: TPanel
Left = 0
Top = 34
Width = 515
Height = 260
Align = alClient
BevelOuter = bvNone
TabOrder = 1
ExplicitTop = 33
ExplicitWidth = 608
ExplicitHeight = 296
object CardPanel1: TCardPanel
Left = 0
Top = 0
Width = 515
Height = 260
Align = alClient
ActiveCard = Card1
BevelOuter = bvNone
Caption = 'CardPanel1'
TabOrder = 0
ExplicitTop = 34
ExplicitWidth = 608
ExplicitHeight = 355
object Card1: TCard
Left = 0
Top = 0
Width = 515
Height = 260
Caption = 'Card1'
CardIndex = 0
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 0
ExplicitWidth = 608
ExplicitHeight = 355
object pnlHeader: TPanel
Left = 0
Top = 0
Width = 515
Height = 32
Margins.Left = 100
Margins.Top = 0
Margins.Right = 150
Margins.Bottom = 0
Align = alTop
Alignment = taLeftJustify
BevelOuter = bvNone
Color = 16443110
Font.Charset = DEFAULT_CHARSET
Font.Color = clGrayText
Font.Height = -19
Font.Name = 'Segoe UI'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 0
ExplicitWidth = 608
end
end
end
end
object MainMenu1: TMainMenu
Left = 320
Top = 192
object menuitemOptions: TMenuItem
Caption = 'Options'
object menuitemPreferences: TMenuItem
Caption = 'Toggle Preferences'
ShortCut = 123
end
object menuitemAbout: TMenuItem
Caption = 'About'
ShortCut = 121
end
end
end
end