delphi - Adding a component inside a scrollbox -
I have a custom component, I currently have to put the A custom component is a If you have a custom component and you always want to be present inside the scrollbalk, the best solution Either there is an example using a This represents a custom component that is derived from Alternatively, if you want to preserve the ability to make layout changes within the scrollbox on design time, the second solution will be to create a custom TScrollbox on the form, then add / Drag the custom component into the scroll box.
How do I go about changing the component, so it automatically puts it inside a scroll box, when it is placed on a form? TGraphicControl .
TLabel to update or expand that component for your own scrollbox, but you can replace it with your custom component.
entity MyScrollBox; The interface uses System.SysUtils, System.Classes, Vcl.Controls, Vcl.Forms, Vcl.StdCtrls; Type TMyScrollComponent = Class (TScrollBox) Private FLabel: TLabel; Process SetLabelText (Attack: string); GetLabelText: string; Build Protected Maker (AOwner: TComponent); Override; Published property LabelText: write SetLabelText to write GetLabelText to the string; End; Process register; Register of implementation process; Start Register Components ('Sample', [TMyScrollComponent]); End; Manufacturer TMyScrollComponent.Create (AOwner: TComponent); Heritage begins; Flabell: = Telebell. Create (self); FLabel.Parent: = Self; FLabel.Caption: = 'Hello from scrollbox!'; End; Process TMyScrollComponent.SetLabelText (ATEX: string); Begin FLabel.Caption: = AText; End; The function TMyScrollComponent.GetLabelText: string; Start the result: = Fable. Caption; End; End.
TScrollBox , it has a
TLabel and
captions property displays through a custom publish property, after this method of
TLabel you can also highlight other properties of your custom control that you want, etc.
TFrame . Just and, after a build, in this tool palette the
standard - & gt; Becomes available under. Frame .
Comments
Post a Comment