ITabCellStyle.NormalDetachedPicture

Syntax

NormalDetachedPicture: IGxImage;

NormalDetachedPicture: Prognoz.Platform.Interop.Drawing.IGxImage;

Description

The NormalDetachedPicture property loads the selected image to a table cell.

Comments

To use images in the cell, set the ITabCellStyle.EnablePictures property to TriState.OnOption.

Images can be added from a folder using the ImageBox and ImageList components.

To add an image from the collection, use the ITabCellStyle.NormalPicture property.

Example

To execute the example, place on the form the Button, TabSheetBox and UiTabSheet components (for Fore.NET example use the TabSheetBoxNet and UiTabSheetNet components) named BUTTON1, TABSHEETBOX1/TABSHEETBOXNET1 and UITABSHEET1/UITABSHEETNET1 respectively. For the TabSheetBox/TabSheetBoxNet component, set the Source/UiSource property to UiTabSheet1/UiTabSheetNet1. Make sure that the root of the C drive contains the Image.png image.

Add links to the system assemblies:

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Sheet: ITabSheet;
    Range: ITabRange;
    Style: ITabCellStyle;
    Image: IGxImage;
Begin
    Sheet := UiTabSheet1.TabSheet;
    Range := Sheet.View.Selection.Range;
    Image := GxImage.FromFile(
"C:\Image.png");
    Style := Range.Style;
    Style.EnablePictures := TriState.OnOption;
    Style.NormalDetachedPicture := Image;
End Sub Button1OnClick;

Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.ForeSystem;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Sheet: ITabSheet;
    Range: ITabRange;
    Style: ITabCellStyle;
    Image: GxImage = 
New GxImageClass_2();
Begin
    Sheet := UiTabSheetNet1.TabSheetUi.TabSheet;
    Range := Sheet.View.Selection.Range;
    Image.CreateFromFile(
"C:\Image.png");
    Style := Range.Style;
    Style.EnablePictures := TriState.tsOnOption;
    Style.NormalDetachedPicture := Image;
End Sub;

As a result, clicking the Button1 button adds the specified image to the selected table cell, for example:

See also:

ITabCellStyle