From Clomosy Docs
AddNewProLabel(TComponent, xName, xCaption): TClProLabel
You can use all of the AddNewLabel properties. Apart from that, there are special uses for ProLabel. Background Color, Text Bold, Border Color, AutoSize etc. There is a simpler way to use these parameters. This is because the json structure is available. You can use properties defined with json structure. Parameters used:
- caption
- Width
- Height
- PositionX
- PositionY
- Align
- TextColor
- BackgroundColor
- TextSize
- TextVerticalAlign
- TextHorizontalAlign
- TextBold
- MarginTop
- MarginBottom
- MarginRight
- MarginLeft
- RoundHeight
- RoundWidth
- BorderColor
- BorderWidth
- AutoSize
Let's define a proLabel.
LblUserName : TClProLabel;
Let's add a proLabel to MyForm and create its property parameters with json structure.
LblUserName := MyForm.AddNewProLabel(MyForm,'LblUserName','User Name :');
clComponent.SetupComponent(LblUserName,'{"Align" : "Center","MarginBottom":115,"Width" :150, "Height":30,"TextColor":"#f5428d","TextSize":12,"TextVerticalAlign":"center", "TextHorizontalAlign":"left","TextBold":"yes"}');
Example:
- Base Syntax
Var
MyForm:TclForm;
Label1: TClProLabel;
procedure setLabel;
begin
Label1 := MyForm.AddNewProLabel(MyForm,'Label1','Clomosy LABEL');
clComponent.SetupComponent(Label1,'{"Align" : "Center","MarginBottom":115,"Width" :150, "Height":30,"TextColor":"#f5428d","TextSize":12,"TextVerticalAlign":"center",
"TextHorizontalAlign":"left","TextBold":"yes"}');
end;
begin
MyForm := TclForm.Create(Self);
setLabel;
MyForm.Run;
end;
- TRObject Syntax
Var
MyForm:TclForm;
Label1: TClProLabel;
void setLabel;
{
Label1 = MyForm.AddNewProLabel(MyForm,'Label1','Clomosy LABEL');
clComponent.SetupComponent(Label1,'{"Align" : "Center","MarginBottom":115,"Width" :150, "Height":30,"TextColor":"#f5428d","TextSize":12,"TextVerticalAlign":"center",
"TextHorizontalAlign":"left","TextBold":"yes"}');
}
{
MyForm = TclForm.Create(Self);
setLabel;
MyForm.Run;
}