标签: tpanel

Delphi组件未绘制

我有组件(TPanel的后代),我实现了Transparency和BrushStyle(使用TImage)属性.

当我在表单上有一个这种类型的组件时,一切都没问题.发髻当我在表格上加注这种类型的更多组件时,只涂上第一个可见组件.当移动窗体并且第一个组件位于其他窗口或外部桌面下时,下一个组件被绘制.

unit TransparentPanel;

interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, stdctrls;

type
  TTransparentPanel = class(TPanel)
  private
    FTransparent: Boolean;
    FBrushStyle: TBrushStyle;
    FImage: TImage;

    procedure SetTransparent(const Value: Boolean);
    procedure SetBrushStyle(const Value: TBrushStyle);
  protected
    procedure CreateParams(var Params: TCreateParams); override;
    procedure Paint; override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property Transparent: Boolean read FTransparent write SetTransparent default
      True;
    property BrushStyle: TBrushStyle read FBrushStyle write SetBrushStyle default
      bsBDiagonal;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('TransparentPanel', [TTransparentPanel]); …
Run Code Online (Sandbox Code Playgroud)

delphi panel tpanel custom-component

1
推荐指数
1
解决办法
3346
查看次数

如何在面板中显示Delphi表单?

我试图按照http://docwiki.embarcadero.com/CodeExamples/XE7/en/FMXEmbeddedForm_(Delphi)的例子,但我遇到了TCustomForm的孩子的第一个问题,这显然是只读的,所以我发表了评论说出来,放在ArgForm.Parent:= ArgParent;代替,但我仍然只得到一个空的屏幕并不能看到那些在我的第二个表格的按钮.

我的主要表格的代码是:

unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, Unit2;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    procedure FormCreate(Sender: TObject);
    procedure EmbedForm(ArgParent : TControl; ArgForm : TCustomForm);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  Form2: TForm2;

implementation

{$R *.fmx}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Form2:= TForm2.Create(Self);
  EmbedForm(Panel1, Form2);
end;

procedure TForm1.EmbedForm(ArgParent: TControl; ArgForm: TCustomForm);
begin
  //while ArgForm.ChildrenCount>0 do
  //begin
    //ArgForm.Children[0]:= ArgParent);
  //end; …
Run Code Online (Sandbox Code Playgroud)

delphi user-interface tform tpanel firemonkey

1
推荐指数
1
解决办法
5704
查看次数

控制在顶部,像TPanel一样可以吗?

我的程序正在执行一项耗时的任务,我想在应用程序窗口中间显示一个TImage,但它不会保持在最顶层 - 我的VST始终位于顶部.但是,当我使用TPanel时,它会保持在顶部?如何让我的TImage做到这一点?

事实上,适用于所有控件的解决方案将是出色的:)

谢谢!

delphi vcl timage tpanel stayontop

0
推荐指数
1
解决办法
4983
查看次数

如何将delphi上TPanel的所有TLabel复制到另一个TPanel?

我在delphi表单上有一个TPanel,当我按下一个按钮并将它们放在其他面板中时,我想复制所有与这个TPanel同属的TLabel.有没有办法做到这一点?谢谢.

delphi parent tlabel tpanel

0
推荐指数
1
解决办法
2798
查看次数

在Delphi中我如何将TPanel变量类型设置为null?

Helo,我有以下东西:selectedPanel应该获得点击的面板对象,如果单击该表单,selectedPanel应为"null",nada,empty等:)

var
     selectedBlock: Tpanel; <== fixed typo

...

procedure TForm1.stubPanelMouseDown(Sender: TObject...
begin

    ...

    Panel:= Sender as TPanel;

    if (*selectedBlock is not null*) then
    begin
            // ie, store the current panel
            selectedBlock:= Panel;
    end
    else
    begin
            // empty the selection
            *selectedBlock:= null*;
    end;
Run Code Online (Sandbox Code Playgroud)

所以问题是:我如何将该变量设置为"null"?执行selectedBlock:= Unassigned会引发错误.

谢谢

编辑:这仍然会引发错误:访问冲突

if (selectedBlock=nil) then <= fixed and works
  begin
    selectedBlock:= Panel;
  end
  else
  begin
     selectedBlock:= nil;
 end;
Run Code Online (Sandbox Code Playgroud)

delphi tpanel

-5
推荐指数
1
解决办法
428
查看次数