RadFormControlBase
Represents the base class for all Telerik forms that provides core functionality for themed form controls. This abstract class serves as the foundation for creating custom forms with advanced UI capabilities and theming support.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public abstract class RadFormControlBase : Form, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl, IComponentTreeHandler, ILayoutHandler, ISupportInitializeNotification, ISupportInitialize, INotifyPropertyChanged, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlContainerControlFormRadFormControlBase...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadFormControlBase class.
public RadFormControlBase()
Fields
public bool controlIsInitializingRootComponent
The current DPI value.
protected int currentDpi
protected bool isBehaviorPrepared
protected bool isPainting
The new bounds for the new DPI that we receive on WM_DPICHANGED.
protected Rectangle newBounds
Properties
Gets or sets a value indicating whether focus cues are shown when available, based on the corresponding control type and the current UI state.
public virtual bool AllowShowFocusCues { get; set; }
Gets or sets a value indicating whether the form customizes its non-client area when under Vista with Composition enabled.
[Browsable(false)]
public virtual bool AllowTheming { get; set; }
Gets or sets the BackColor of the control. This is actually the BackColor property of the root element.
public override Color BackColor { get; set; }
Overrides:
Gets the ComponentInputBehavior instance that handles all logic and user interaction in RadControl.
[Browsable(false)]
public virtual ComponentInputBehavior Behavior { get; }
Gets the command bindings collection for input handling.
[TypeConverter(typeof(ExpandableObjectConverter))]
public InputBindingsCollection CommandBindings { get; }
Gets or sets the creation parameters for the window.
protected override CreateParams CreateParams { get; }
Overrides:
Gets the element tree for this control.
public ComponentThemableElementTree ElementTree { get; }
Implements:
Gets or sets a value indicating whether the Analytics functionality is enabled or disbaled for this control.
[Browsable(true)]
public virtual bool EnableAnalytics { get; set; }
Implements:
Gets or sets a value indicating whether the Key Map (Office 2007 like accelerator keys map) is used for this specific control. Currently this option is implemented for the RadRibbonBar control only.
[Browsable(true)]
public bool EnableKeyMap { get; set; }
Gets or sets the currently focused element.
[Browsable(false)]
public RadElement FocusedElement { get; set; }
Gets or sets the Font of the control. This is actually the Font property of the root element.
public override Font Font { get; set; }
Overrides:
Gets or sets the ForeColor of the control. This is actually the ForeColor property of the root element.
public override Color ForeColor { get; set; }
Overrides:
Gets the behavior associated with this form if any.
public FormControlBehavior FormBehavior { get; set; }
Gets or sets the FormBorderStyle of the Form.
public FormBorderStyle FormBorderStyle { get; set; }
Gets a value indicating whether the form has its own toolbar.
protected virtual bool HasOwnToolbar { get; }
Gets or sets the ImageList that contains the images displayed by this control.
[Browsable(true)]
public ImageList ImageList { get; set; }
Implements:
Gets or sets the scaling size for images.
public Size ImageScalingSize { get; set; }
Implements:
Gets a value indicating whether the control is in design mode.
public bool IsDesignMode { get; }
Implements:
Gets a value indicating whether DPI scaling is suspended.
public bool IsDpiScalingSuspended { get; }
Gets a value indicating whether the component is initialized.
public bool IsInitialized { get; }
Implements:
Gets a value indicating whether the control is currently performing scaling operations.
public bool IsPerformingScale { get; }
Gets a value indicating whether the control's update is suspended.
protected bool IsUpdateSuspended { get; }
Gets or sets the maximum size of the control.
public override Size MaximumSize { get; set; }
Overrides:
Gets or sets the minimum size of the control.
public override Size MinimumSize { get; set; }
Overrides:
Gets the RootElement of the control.
[Browsable(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public RootRadElement RootElement { get; }
Implements:
Gets or sets a value indicating whether ToolTips are shown for the RadItem objects contained in the RadControl.
public virtual bool ShowItemToolTips { get; set; }
Gets or sets the site of the control and manages design mode state.
public override ISite Site { get; set; }
Overrides:
Gets or sets the ImageList that contains the images displayed by this control.
[Browsable(true)]
public virtual ImageList SmallImageList { get; set; }
Gets or sets the scaling size for small images.
public Size SmallImageScalingSize { get; set; }
Implements:
Gets or sets the name of the theme class for styling.
public virtual string ThemeClassName { get; set; }
Gets or sets the theme name.
[Browsable(true)]
public string ThemeName { get; set; }
Implements:
Gets or sets the windows related settings.
public WindowsSettings WindowsSettings { get; set; }
Methods
Adds an invalidated rectangle to the control.
protected void AddInvalidatedRect(Rectangle rect)
The rectangle to invalidate.
Signals the object that initialization is starting.
public virtual void BeginInit()
Implements:
Constructs the core components of the form control including managers and element tree.
protected virtual void Construct()
Called when the control theme has changed.
public void ControlThemeChangedCallback()
Implements:
Creates the child items for the specified parent element.
protected virtual void CreateChildItems(RadElement parent)
The parent element to create child items for.
Creates the handle for the control.
protected override void CreateHandle()
Overrides:
Creates the root element for the form.
Disposes of the resources (other than memory) used by the RadFormControlBase.
protected override void Dispose(bool disposing)
True to release both managed and unmanaged resources; false to release only unmanaged resources.
Overrides:
Signals the object that initialization is complete.
public virtual void EndInit()
Implements:
Retrieves the size of a rectangular area into which a control can be fitted.
Handles DPI change operations.
protected virtual void HandleDpiChanged()
Called to initialize the behavior of the form when implemented in a derived class.
protected abstract FormControlBehavior InitializeFormBehavior()
A FormControlBehavior instance that defines the form's behavior.
Invalidates the specified element within the given bounds.
public void InvalidateElement(RadElement element, Rectangle bounds)
The element to invalidate.
boundsRectangleThe bounds to invalidate.
Implements:
Invalidates the specified element.
public void InvalidateElement(RadElement element)
The element to invalidate.
Implements:
Invalidates the control if not suspended.
public void InvalidateIfNotSuspended()
Implements:
Invokes a layout callback.
public void InvokeLayoutCallback(LayoutCallback callback)
The callback to invoke.
Implements:
Loads the element tree. While not loaded, no layout operations are allowed upon the tree. By default, the tree will be loaded when the control is displayed for the first time.
public virtual void LoadElementTree()
Implements:
Loads the element tree using the specified desired size.
Raises the BackColorChanged event.
Called when the control is created and loads the element tree.
protected override void OnCreateControl()
Overrides:
Called when a display property has changed.
protected virtual void OnDisplayPropertyChanged(RadPropertyChangedEventArgs e)
A RadPropertyChangedEventArgs that contains the event data.
Raises the FontChanged event.
Raises the ForeColorChanged event.
Raises the HandleCreated event.
Raises the Layout event.
protected override void OnLayout(LayoutEventArgs levent)
A LayoutEventArgs that contains the event data.
Overrides:
In this override we set the initial dpi scaling.
Notifies that the control is about to be visualized.
Raises the property changed notification with the specified event arguments.
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
A PropertyChangedEventArgs that contains the event data.
Raises the property changed notification for the specified property name.
protected virtual void OnNotifyPropertyChanged(string propertyName)
The name of the property that changed.
Raises the Paint event and delegates to the form behavior if present.
protected override void OnPaint(PaintEventArgs e)
A PaintEventArgs that contains the event data.
Overrides:
Raises the background paint event and delegates to the form behavior if present.
protected override void OnPaintBackground(PaintEventArgs e)
A PaintEventArgs that contains the event data.
Overrides:
Raises the ParentChanged event.
Raises the ScreenTipNeeded event.
protected virtual void OnScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
The source of the event.
eScreenTipNeededEventArgsA ScreenTipNeededEventArgs that contains the event data.
Called when the theme has changed.
protected virtual void OnThemeChanged()
Raises the ThemeNameChanged event.
protected virtual void OnThemeNameChanged(ThemeNameChangedEventArgs e)
A ThemeNameChangedEventArgs that contains the event data.
Raises the ToolTipTextNeeded event.
protected virtual void OnToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
The source of the event.
eToolTipTextNeededEventArgsA ToolTipTextNeededEventArgs that contains the event data.
Raises the VisibleChanged event.
Handles the WM_SETTINGCHANGE message to detect Windows theme changes.
Performs design mode location correction for the form.
protected virtual void PerformDesignModeLocationCorrection(ref Message msg)
The Windows message to process.
Processes a capture request from the specified element.
protected virtual bool ProcessCaptureChangeRequested(RadElement element, bool capture)
The element which requested the capture.
captureboolTrue to capture; otherwise, false.
Returns:True if the capture request is approved; otherwise, false.
Processes a dialog box key.
Processes a focus request from the specified element.
protected virtual bool ProcessFocusRequested(RadElement element)
The element that requested the focus.
Returns:True if focus is approved; otherwise, false.
Registers a hosted control with this form.
public void RegisterHostedControl(RadHostItem hostElement)
The host element containing the control to register.
Implements:
Resets the behavior associated with the Form. This method is used internally.
public void ResetFormBehavior(bool callInitialize)
True to call the InitializeFormBehavior method after resetting; otherwise, false.
Resumes DPI scaling operations.
public void ResumeDpiScaling()
Resumes the painting of the control.
public void ResumeUpdate()
Implements:
Resumes the painting of the control.
public void ResumeUpdate(bool invalidate)
True to invalidate the control when resuming; otherwise, false.
Scales the control's location, size, and other properties.
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
The scaling factor.
specifiedBoundsSpecifiedWhich bounds to scale.
Overrides:
Performs the work of setting the specified bounds of this control.
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
The new Left property value of the control.
yintThe new Top property value of the control.
widthintThe new Width property value of the control.
heightintThe new Height property value of the control.
specifiedBoundsSpecifiedA bitwise combination of the BoundsSpecified values.
Overrides:
Determines whether the specified RadProperty should be serialized.
protected virtual bool ShouldSerializeProperty(RadProperty property)
The property to check for serialization.
Returns:True if the property should be serialized; otherwise, false.
Suspends DPI scaling operations.
public void SuspendDpiScaling()
Suspends the painting of the control.
public void SuspendUpdate()
Implements:
Unregisters a hosted control from this form.
public void UnregisterHostedControl(RadHostItem hostElement, bool removeControl)
The host element containing the control to unregister.
removeControlboolTrue to remove the control from the Controls collection; otherwise, false.
Implements:
Updates which button is the default button.
protected override void UpdateDefaultButton()
Overrides:
Events
Occurs when the component's initialization is complete.
public event EventHandler Initialized
Implements:
Occurs when a property of an object changes. Calling the event is developer's responsibility.
[Browsable(false)]
public event PropertyChangedEventHandler PropertyChanged
Implements:
Occurs prior to the ScreenTip of a RadItem instance inside the RadControl being displayed.
public event ScreenTipNeededEventHandler ScreenTipNeeded
Occurs when the theme name has changed.
public event ThemeNameChangedEventHandler ThemeNameChanged
Implements:
Occurs when a RadItem instance inside the RadControl requires ToolTip text.
public event ToolTipTextNeededEventHandler ToolTipTextNeeded
Implements:
Occurs when the Windows theme is changed (to Light, Dark or HighContrast).
public event WindowsThemeEventHandler WindowsThemeChanged