Syncfusion.XlsIO.Base
Example 


DisplayAsIcon Property (IOleObject)

Gets or sets a value indicating whether [display as icon].
Syntax
'Declaration
 
Property DisplayAsIcon As Boolean
'Usage
 
Dim instance As IOleObject
Dim value As Boolean
 
instance.DisplayAsIcon = value
 
value = instance.DisplayAsIcon
bool DisplayAsIcon {get; set;}

Property Value

true if [display as icon]; otherwise, false.
Example
The following code illustrates how to set DisplayAsIcon property.
using Syncfusion.XlsIO;
using System.Drawing;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Create image stream
            Image image = Image.FromFile("image.png");
            
            //Add ole object
            IOleObject oleObject = worksheet.OleObjects.Add("Shapes.xlsx", image, OleLinkType.Embed);
            
            //Set display as icon
            oleObject.DisplayAsIcon = true;
            
            //Save and dispose
            workbook.SaveAs("OLEObjects.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also