Rab*_*wal 3 delphi user-interface
我想知道如何在Get It Package Manager窗口中实现阴影效果.阴影区域标记为红色.
Rem*_*eau 12
没有TPanel创建阴影的属性.
使用Spy ++,我可以看到GetIt包管理器窗口使用3个标准TPanel对象(然后在其中有其他控件),并且顶部TPanel对象和两个下层TPanel对象之间没有其他控件.
我怀疑这种效果很可能是通过Margin在顶部下方定义一个底部TPanel,然后GraphUtil.GradientFillCanvas()在该边距区域内的父Form上自定义绘制渐变(例如with )来完成的.
我能够使用以下测试代码在10.0 Seattle重现效果:
unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls;
type
TForm2 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
uses
GraphUtil;
procedure TForm2.FormPaint(Sender: TObject);
var
R: TRect;
begin
R := ClientRect;
R.Top := Panel1.Top + Panel1.Height;
R.Bottom := Panel2.Top;
GradientFillCanvas(Canvas, clGray, clWhite, R, gdVertical);
end;
end.
Run Code Online (Sandbox Code Playgroud)
object Form2: TForm2
Left = 0
Top = 0
Caption = 'Form2'
ClientHeight = 266
ClientWidth = 622
Color = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnPaint = FormPaint
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
AlignWithMargins = True
Left = 0
Top = 0
Width = 622
Height = 41
Margins.Left = 0
Margins.Top = 0
Margins.Right = 0
Align = alTop
BevelOuter = bvNone
Caption = 'Panel1'
ParentBackground = False
TabOrder = 0
ExplicitLeft = 224
ExplicitTop = 128
ExplicitWidth = 185
end
object Panel2: TPanel
AlignWithMargins = True
Left = 0
Top = 47
Width = 185
Height = 219
Margins.Left = 0
Margins.Bottom = 0
Align = alLeft
Caption = 'Panel2'
TabOrder = 1
ExplicitLeft = 224
ExplicitTop = 128
ExplicitHeight = 41
end
object Panel3: TPanel
AlignWithMargins = True
Left = 191
Top = 47
Width = 431
Height = 219
Margins.Right = 0
Margins.Bottom = 0
Align = alClient
Caption = 'Panel3'
TabOrder = 2
ExplicitLeft = 224
ExplicitTop = 128
ExplicitWidth = 185
ExplicitHeight = 41
end
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
625 次 |
| 最近记录: |