ITabCellFormatDlg.ShowDialog

Syntax

ShowDialog(ParentWnd: IWin32Window): Boolean;

Parameters

ParentWnd - the window with respect to which the formatting dialog box opens modally.

Description

The ShowDialog method shows formatting dialog box and returns result with which this dialog box was closed.

Comments

The method returns True if the OK button was pressed after editing, and False if the Cancel button was pressed after editing.

Example

Executing the example requires a form, a button located on this form with the Button1 identifier, the TabSheetBox component and the UiTabSheet component with the UiTabSheet1 identifier, which is the data source for TabSheetBox.

This example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    FormatDlg: ITabCellFormatDlg;
    Sel: ITabSelection;
    SelRange: ITabRange;
Begin
    FormatDlg := New TabCellFormatDlg.Create;
    // Exclude
    FormatDlg.ExcludePage(TabFormatDlgPages.CellAlignment);
    FormatDlg.ExcludePage(TabFormatDlgPages.CellBorders);
   // Block:
    FormatDlg.DisableItem(TabFormatDlgItems.FontName);
    FormatDlg.DisableItem(TabFormatDlgItems.FontBold);
    FormatDlg.DisableItem(TabFormatDlgItems.Category);
    // Choose active page
    FormatDlg.ActivePage := TabFormatDlgPages.CellView;
    If FormatDlg.ShowDialog(Self As IWin32Window) Then
        Sel := UiTabSheet1.TabSheet.View.Selection;
        SelRange := Sel.Range;
        SelRange.Style := FormatDlg.Style;
    End If;
End Sub Button1OnClick;

Clicking the button opens formatting dialog box on the Fill tab. In the dialog box the Alignment and Borders tabs are hidden and it will not be available to set font name, to set bold text attribute and to select any data format. Select desired style settings and click the OK button to apply style to selected cells.

See also:

ITabCellFormatDlg