block name

  • 1.5K Views
  • Last Post 07 March 2014
vbknight posted this 05 March 2014

is it possible to replace the visible number on block with a name? or possible annotate the block with name.

Order By: Standard | Newest | Votes
vbknight posted this 05 March 2014

if you can provide sample code the better . TIA

SDK_support posted this 06 March 2014

Yes it is possible, please use IBlock::Name property for this purpose. Please see more details in Help → API Reference → Layout-Related Objects → Block.

vbknight posted this 07 March 2014

I'ved tried this but still my block did not change it is still has number instead of name.

           FREngine.IBlock activeblock = imgvwr.FRPage.Layout.Blocks[e.blockIndex];

             //change color
            if (activeblock.Type == FREngine.BlockTypeEnum.BT_Text)
            {
                activeblock.Name = "SampleBlockName";
                imageViewer.Invalidate(true);

            }

// or this

FREngine.IBlock activeblock = imgvwr.FRPage.Layout.Blocks[e.blockIndex];

             //change color
            if (activeblock.Type == FREngine.BlockTypeEnum.BT_Text)
            {
                a  activeblock.set_UserProperty(Name, "RealEstate");
                imageViewer.Invalidate(true);
            }

SDK_support posted this 11 March 2014

To be able to change the block name, please try to use property IBlock::Description (Help → API Reference → Layout-Related Objects → Block). This property enables to set any text instead of block number, also you can set an empty string. You may set this property to “null” in case you need to return displaying of block number. Please see the sample code in C#:

private void testButton_Click(object sender, EventArgs e) {

FREngine.IBlock block = Document.Pages[0].Layout.VisualBlocks[0];

block.set_UserProperty("VisualComponents.BlockDescription", "My Text");`    
block.set_UserProperty("VisualComponents.BlockDescription", "");`

block.set_UserProperty("VisualComponents.BlockDescription", null);

}

  • Liked by
  • vbknight
Close