'Declaration Public Event ThemeApplying As System.EventHandler(Of ThemeApplyingEventArgs)
public event System.EventHandler<ThemeApplyingEventArgs> ThemeApplying
Event Data
The event handler receives an argument of type ThemeApplyingEventArgs containing data related to this event. The following ThemeApplyingEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel | (Inherited from System.ComponentModel.CancelEventArgs) |
Handled | Gets or sets a value indicating whether the event was handled. |
ThemeName | Gets the name of the theme to be assigned. |
Remarks
This event fires after a theme name is assigned or selected in the drop-down list, and allows the program to cancel the theme apply to form controls, if necessary.
Example
The code below handles the ThemeApplying event after theme name was assigned. As a result, the theme name was assigned to SelectedThemeName property, but the theme was not applied on the form due to "e.Handled = true".
var c1ThemePicker1 = new C1ThemePicker(); c1ThemePicker1.ThemeApplying += c1ThemePicker1_ThemeApplying; c1ThemePicker1.SelectedThemeName = "BeigeOne"; // assign theme name private void c1ThemePicker1_ThemeApplying(object sender, ThemeApplyingEventArgs e) { var themeName = e.ThemeName; // is "BeigeOne" e.Handled = true; // The theme will not be applied to the form controls }
See Also