tpanel

How best to create a TPanel with a close 'cross' button in the top right?

怎甘沉沦 提交于 2019-12-04 21:37:23
问题 There are several third-pary controls (such as the Raize Components) which have a close 'cross' button 'option' (eg the page control). My requirement is simpler, I'd like to plonk a cross 'button' aligned top right on to a TPanel and access its clicked event. Is there either a simple way of doint this without creating a TPanel descendent, or is there a paid or free library component that I can use? 回答1: I wrote a control for you. unit CloseButton; interface uses Windows, Messages, SysUtils,

How best to create a TPanel with a close 'cross' button in the top right?

不想你离开。 提交于 2019-12-03 13:20:28
There are several third-pary controls (such as the Raize Components ) which have a close 'cross' button 'option' (eg the page control). My requirement is simpler, I'd like to plonk a cross 'button' aligned top right on to a TPanel and access its clicked event. Is there either a simple way of doint this without creating a TPanel descendent, or is there a paid or free library component that I can use? I wrote a control for you. unit CloseButton; interface uses Windows, Messages, SysUtils, Classes, Controls, UxTheme; type TCloseButton = class(TCustomControl) private FMouseInside: boolean;

how to copy all the TLabels parented with a TPanel on delphi to another TPanel?

喜欢而已 提交于 2019-12-02 20:02:49
问题 I have a TPanel on a delphi form, I want to copy all the TLabels parented with this TPanel when i press a button and put them in other panel. Is there a way to do that? Thanks. 回答1: To copy the TLabel controls from one TPanel to another you can use something like this Procedure CopyLabels(ParentControl,DestControl:TWinControl); var i : integer; ALabel : TLabel; begin for i := 0 to ParentControl.ControlCount - 1 do if ParentControl.Controls[i] is TLabel then begin ALabel:=TLabel.Create

how to copy all the TLabels parented with a TPanel on delphi to another TPanel?

左心房为你撑大大i 提交于 2019-12-02 08:45:55
I have a TPanel on a delphi form, I want to copy all the TLabels parented with this TPanel when i press a button and put them in other panel. Is there a way to do that? Thanks. To copy the TLabel controls from one TPanel to another you can use something like this Procedure CopyLabels(ParentControl,DestControl:TWinControl); var i : integer; ALabel : TLabel; begin for i := 0 to ParentControl.ControlCount - 1 do if ParentControl.Controls[i] is TLabel then begin ALabel:=TLabel.Create(DestControl); ALabel.Parent :=DestControl; ALabel.Left :=ParentControl.Controls[i].Left; ALabel.Top :=ParentControl

Delphi: How to programmatically adjust visual ordering of components with align = alTop

亡梦爱人 提交于 2019-11-30 09:10:15
I've got a form with a number of panels, each of which has Align=alTop, so they stack down nicely from the top of the form. However, I want to dynamically change the appearance order of these panels - i.e, move them up and down. What's the best way of doing this? You can easily move a top-aligned panel to the top by setting its Top property to 0 . Do this in reverse requested order (bottom panel first) and you are done. Move them the same way you'd move them at design time with the mouse: Set the current panel's Top property to one less than the Top property of the panel you want to be below