PaletteBorderColors(PaletteID: String): Array;
PaletteBorderColors(PaletteID: string): System.Array;
PaletteID. Palette identifier.
The PaletteBorderColors method is used to get an array of main border colors by palette identifier.
To get an array of strings with identifiers of alternative palette sets, use the IVisStyleProvider.PaletteIDs method.
Executing the example requires a form that contains the ComboBox component with the ComboBox1 identifier, the UiTabSheet component with the UiTabSheet1 identifier and the TabSheetBox component with the TabSheetBox1 identifier. Specify UiTabSheet1 as a data source for the TabSheetBox1 component. The ComboBox1 component contains a list of styles.
The example is a handler of the OnChange event for the ComboBox1 component.
Add a link to the Drawing system assembly.
Sub ComboBox1OnChange(Sender: Object; Args: IEventArgs);
Var
sp: IVisStyleProvider;
TabSheet: ITabSheet;
count, i, Index: Integer;
Item: String;
BorderColor: Array Of Integer;
Begin
sp := New VisStyleProvider.Create;
TabSheet := UiTabSheet1.TabSheet;
Index := ComboBox1.ItemIndex;
Item := ComboBox1.Items.Item(Index);
BorderColor := sp.PaletteBorderColors((Item="default")?"":Item);
For i := 0 To sp.PaletteIDs.Length-1 Do
TabSheet.Cell(i,count).Style.BorderColor(TabBorder.Outline) := GxColor.FromValue(BorderColor[i]*-1);
End For;
count := count + 1;
End Sub ComboBox1OnChange;
When the style is selected in the ComboBox1 drop-down list, table sheet cells are filled according to the selected style.
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.Tab;
Imports Prognoz.Platform.Interop.Drawing;
…
Private Sub comboBox1_SelectedValueChanged(sender: System.Object; e: System.EventArgs);
Var
sp: IVisStyleProvider;
TabSheet: ITabSheet;
count, i, Index: Integer;
Item: object;
BorderColor: Array Of Integer;
GxColor: GxColorClassClass = New GxColorClassClass();
value: uinteger;
Begin
sp := New VisStyleProvider.Create();
TabSheet := uiTabSheetNet1.TabSheetUi.TabSheet;
Index := comboBox1.SelectedIndex;
Item := comboBox1.Items.Item[Index];
BorderColor := sp.PaletteBorderColors((Item="default")?"":Item);
For i := 0 To sp.PaletteIDs.Length-1 Do
value := (BorderColor[i]*-1) As uinteger;
TabSheet.Cell[i,count].Style.BorderColor(TabBorder.Outline) := GxColor.FromValue(value);
End For;
count := count + 1;
End Sub;
See also: