BackgroundPictureWrapMode: TabFormatWrapMode;
BackgroundPictureWrapMode: Prognoz.Platform.Interop.Tab.TabFormatWrapMode;
The BackgroundPictureWrapMode property determines the method of background image overlay.
To execute the example a form, a button named Button1 positioned on this form, the TabSheetBox component named TabSheetBox1, and a data source for TabSheetBox1 are required.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
TSheet: ITabSheet;
Selection: ITabRange;
Style: ITabCellStyle;
i: Integer;
Begin
TSheet := TabSheetBox1.Source.GetTabSheet;
i := TSheet.Images.Add(GxImage.FromFile("c:\Background.png"));
Selection := TSheet.View.Selection.Range;
//Style parameters
Style := Selection.Style;
//Setting image
Style.EnablePictures := TriState.OnOption;
Style.BackgroundPicture := i;
Style.BackgroundPictureWrapMode := TabFormatWrapMode.Tile;
End Sub Button1OnClick;
On clicking the button a new background image is set for the cells selected in TabSheetBox1: the image is loaded from the specified file and will be tiled to fill each cell area.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Tab;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
TSheet: TabSheet;
GxImageCls: GxImageClass = New GxImageClassClass();
Selection: ITabRange;
Style: ITabCellStyle;
i: Integer;
Begin
TSheet := TabSheetBoxNet1.Source.GetTabSheet();
i := TSheet.Images.Add(GxImageCls.FromFile("c:\Background.png"));
Selection := TSheet.View.Selection.Range;
//Style parameters
Style := Selection.Style;
//Setting image
Style.EnablePictures := TriState.tsOnOption;
Style.BackgroundPicture := i;
Style.BackgroundPictureWrapMode := TabFormatWrapMode.tfwmTile;
End Sub;
See also: