From Clomosy Docs

Revision as of 14:12, 14 August 2023 by ClomosyManager (talk | contribs) (Created page with " 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:<br> * caption * Width * Height * PositionX * PositionY * Align * TextColor * BackgroundColor...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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"}');

Code:

Var   
MyForm:TclForm;
LblUserName: TClProLabel;
procedure SetUsername; begin 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"}');
end;
begin MyForm := TclForm.Create(Self); SetUsername; MyForm.Run; end;