How to get BarCodeView Bounds after setting it to autosize?

I am creating a BarCodeView on Delphi at runtime and then adding it to a ReportPage on a TfrxReport.

the barcode displays just fine, but when I try to get its width I get 0 even if it is created and clearly longer than 0.

here is some code.

Page:= Report.FindObject('Page1') as TfrxReportPage;;

BarCode:= TfrxBarCodeView.Create(Page); BarCode.Name:='Codigo';

BarCode.WideBarRatio:=2;
BarCode.Zoom:=1;
BarCode Font.Size:=6;
BarCode.ShowText:= True;
BarCode.BarType:= bcCodeEAN128;
BarCode.Text:= 'Something123';

BarCode.AutoSize:=True;
BarCode.Height:= 50;
BarCode.Top:= 5;
BarCode.Left:= 5;

now, if I try to check the barcode view properties, I get 0 from it'd width property, even if I call the next:

BarCode:=Report.FindComponent('Codigo') as TfrxBarCodeView;

when showing a message like this:
ShowMessage('code width: '+BarCode.Width.ToString);

I get 0 even if the BarCodeView displays fine in the report.

any ideas how to get those properties right with the autosize enabled and creating the barcode at runtime from Delphi?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.