ClassRadFormControlBase
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
RadFormControlBase()
Initializes a new instance of the RadFormControlBase class.
Declaration
public RadFormControlBase()
Fields
currentDpi
The current DPI value.
newBounds
The new bounds for the new DPI that we receive on WM_DPICHANGED.
Properties
AllowShowFocusCues
Gets or sets a value indicating whether focus cues are shown when available, based on the corresponding control type and the current UI state.
Declaration
public virtual bool AllowShowFocusCues { get; set; }
Property Value
AllowTheming
Gets or sets a value indicating whether the form customizes its non-client area when under Vista with Composition enabled.
Declaration
[Browsable(false)]
public virtual bool AllowTheming { get; set; }
Property Value
BackColor
Gets or sets the BackColor of the control. This is actually the BackColor property of the root element.
Declaration
public override Color BackColor { get; set; }
Property Value
Overrides
Behavior
Gets the ComponentInputBehavior instance that handles all logic and user interaction in RadControl.
Declaration
[Browsable(false)]
public virtual ComponentInputBehavior Behavior { get; }
Property Value
CommandBindings
Gets the command bindings collection for input handling.
Declaration
[TypeConverter(typeof(ExpandableObjectConverter))]
public InputBindingsCollection CommandBindings { get; }
Property Value
CreateParams
Gets or sets the creation parameters for the window.
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Overrides
ElementTree
Gets the element tree for this control.
Declaration
public ComponentThemableElementTree ElementTree { get; }
Property Value
Implements
EnableAnalytics
Gets or sets a value indicating whether the Analytics functionality is enabled or disbaled for this control.
Declaration
[Browsable(true)]
public virtual bool EnableAnalytics { get; set; }
Property Value
Implements
EnableKeyMap
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.
Declaration
[Browsable(true)]
public bool EnableKeyMap { get; set; }
Property Value
FocusedElement
Gets or sets the currently focused element.
Declaration
[Browsable(false)]
public RadElement FocusedElement { get; set; }
Property Value
Font
Gets or sets the Font of the control. This is actually the Font property of the root element.
ForeColor
Gets or sets the ForeColor of the control. This is actually the ForeColor property of the root element.
Declaration
public override Color ForeColor { get; set; }
Property Value
Overrides
FormBehavior
Gets the behavior associated with this form if any.
Declaration
public FormControlBehavior FormBehavior { get; set; }
Property Value
FormBorderStyle
Gets or sets the FormBorderStyle of the Form.
Declaration
public FormBorderStyle FormBorderStyle { get; set; }
Property Value
HasOwnToolbar
Gets a value indicating whether the form has its own toolbar.
ImageList
Gets or sets the ImageList that contains the images displayed by this control.
Declaration
[Browsable(true)]
public ImageList ImageList { get; set; }
Property Value
Implements
ImageScalingSize
Gets or sets the scaling size for images.
Declaration
public Size ImageScalingSize { get; set; }
Property Value
Implements
IsDesignMode
Gets a value indicating whether the control is in design mode.
IsDpiScalingSuspended
Gets a value indicating whether DPI scaling is suspended.
IsInitialized
Gets a value indicating whether the component is initialized.
IsLoaded
Gets a value indicating whether the control is loaded.
IsPerformingScale
Gets a value indicating whether the control is currently performing scaling operations.
IsUpdateSuspended
Gets a value indicating whether the control's update is suspended.
MaximumSize
Gets or sets the maximum size of the control.
Declaration
public override Size MaximumSize { get; set; }
Property Value
Overrides
MinimumSize
Gets or sets the minimum size of the control.
Declaration
public override Size MinimumSize { get; set; }
Property Value
Overrides
RootElement
Gets the RootElement of the control.
Declaration
[Browsable(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public RootRadElement RootElement { get; }
Property Value
Implements
ShowItemToolTips
Gets or sets a value indicating whether ToolTips are shown for the RadItem objects contained in the RadControl.
Declaration
public virtual bool ShowItemToolTips { get; set; }
Property Value
Site
Gets or sets the site of the control and manages design mode state.
Declaration
public override ISite Site { get; set; }
Property Value
Overrides
SmallImageList
Gets or sets the ImageList that contains the images displayed by this control.
Declaration
[Browsable(true)]
public virtual ImageList SmallImageList { get; set; }
Property Value
SmallImageScalingSize
Gets or sets the scaling size for small images.
Declaration
public Size SmallImageScalingSize { get; set; }
Property Value
Implements
ThemeClassName
Gets or sets the name of the theme class for styling.
Declaration
public virtual string ThemeClassName { get; set; }
Property Value
ThemeName
Gets or sets the theme name.
Declaration
[Browsable(true)]
public string ThemeName { get; set; }
Property Value
Implements
WindowsSettings
Gets or sets the windows related settings.
Declaration
public WindowsSettings WindowsSettings { get; set; }
Property Value
Methods
AddInvalidatedRect(Rectangle)
Adds an invalidated rectangle to the control.
Declaration
protected void AddInvalidatedRect(Rectangle rect)
Parameters
rect
The rectangle to invalidate.
BeginInit()
Signals the object that initialization is starting.
Declaration
public virtual void BeginInit()
Implements
CallBaseWndProc(ref Message)
Calls the base WndProc method.
Construct()
Constructs the core components of the form control including managers and element tree.
Declaration
protected virtual void Construct()
ControlThemeChangedCallback()
Called when the control theme has changed.
Declaration
public void ControlThemeChangedCallback()
Implements
CreateChildItems(RadElement)
Creates the child items for the specified parent element.
Declaration
protected virtual void CreateChildItems(RadElement parent)
Parameters
parent
The parent element to create child items for.
CreateHandle()
Creates the handle for the control.
Declaration
protected override void CreateHandle()
Overrides
CreateRootElement()
Creates the root element for the form.
Declaration
protected virtual RootRadElement CreateRootElement()
Returns
A new RootRadElement instance.
Dispose(bool)
Disposes of the resources (other than memory) used by the RadFormControlBase.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
True to release both managed and unmanaged resources; false to release only unmanaged resources.
Overrides
EndInit()
Signals the object that initialization is complete.
Declaration
public virtual void EndInit()
Implements
GetPreferredSize(Size)
Retrieves the size of a rectangular area into which a control can be fitted.
HandleDpiChanged()
Handles DPI change operations.
Declaration
protected virtual void HandleDpiChanged()
InitializeFormBehavior()
Called to initialize the behavior of the form when implemented in a derived class.
Declaration
protected abstract FormControlBehavior InitializeFormBehavior()
Returns
A FormControlBehavior instance that defines the form's behavior.
InvalidateElement(RadElement)
Invalidates the specified element.
Declaration
public void InvalidateElement(RadElement element)
Parameters
element
The element to invalidate.
Implements
InvalidateElement(RadElement, Rectangle)
Invalidates the specified element within the given bounds.
Declaration
public void InvalidateElement(RadElement element, Rectangle bounds)
Parameters
element
The element to invalidate.
bounds
The bounds to invalidate.
Implements
InvalidateIfNotSuspended()
Invalidates the control if not suspended.
Declaration
public void InvalidateIfNotSuspended()
Implements
InvokeLayoutCallback(LayoutCallback)
Invokes a layout callback.
Declaration
public void InvokeLayoutCallback(LayoutCallback callback)
Parameters
callback
The callback to invoke.
Implements
LoadElementTree()
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.
Declaration
public virtual void LoadElementTree()
Implements
LoadElementTree(Size)
Loads the element tree using the specified desired size.
Declaration
public virtual void LoadElementTree(Size desiredSize)
Parameters
desiredSize
Implements
OnAutoSizeChanged(EventArgs)
Raises the AutoSizeChanged event.
OnBackColorChanged(EventArgs)
Raises the BackColorChanged event.
OnCreateControl()
Called when the control is created and loads the element tree.
Declaration
protected override void OnCreateControl()
Overrides
OnDisplayPropertyChanged(RadPropertyChangedEventArgs)
Called when a display property has changed.
Declaration
protected virtual void OnDisplayPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
A RadPropertyChangedEventArgs that contains the event data.
OnFontChanged(EventArgs)
Raises the FontChanged event.
OnForeColorChanged(EventArgs)
Raises the ForeColorChanged event.
OnHandleCreated(EventArgs)
Raises the HandleCreated event.
OnLayout(LayoutEventArgs)
Raises the Layout event.
Declaration
protected override void OnLayout(LayoutEventArgs levent)
Parameters
levent
A LayoutEventArgs that contains the event data.
Overrides
OnLoad(EventArgs)
In this override we set the initial dpi scaling.
Declaration
protected override void OnLoad(EventArgs e)
Parameters
e
Overrides
OnLoad(Size)
Notifies that the control is about to be visualized.
Declaration
protected virtual void OnLoad(Size desiredSize)
Parameters
desiredSize
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Raises the property changed notification with the specified event arguments.
Declaration
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
A PropertyChangedEventArgs that contains the event data.
OnNotifyPropertyChanged(string)
Raises the property changed notification for the specified property name.
Declaration
protected virtual void OnNotifyPropertyChanged(string propertyName)
Parameters
propertyName
The name of the property that changed.
OnPaint(PaintEventArgs)
Raises the Paint event and delegates to the form behavior if present.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
e
A PaintEventArgs that contains the event data.
Overrides
OnPaintBackground(PaintEventArgs)
Raises the background paint event and delegates to the form behavior if present.
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
Parameters
e
A PaintEventArgs that contains the event data.
Overrides
OnParentChanged(EventArgs)
Raises the ParentChanged event.
OnScreenTipNeeded(object, ScreenTipNeededEventArgs)
Raises the ScreenTipNeeded event.
Declaration
protected virtual void OnScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
Parameters
sender
The source of the event.
e
A ScreenTipNeededEventArgs that contains the event data.
OnShown(EventArgs)
Declaration
protected override void OnShown(EventArgs e)
Parameters
e
Overrides
OnThemeChanged()
Called when the theme has changed.
Declaration
protected virtual void OnThemeChanged()
OnThemeNameChanged(ThemeNameChangedEventArgs)
Raises the ThemeNameChanged event.
Declaration
protected virtual void OnThemeNameChanged(ThemeNameChangedEventArgs e)
Parameters
e
A ThemeNameChangedEventArgs that contains the event data.
OnToolTipTextNeeded(object, ToolTipTextNeededEventArgs)
Raises the ToolTipTextNeeded event.
Declaration
protected virtual void OnToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
Parameters
sender
The source of the event.
e
A ToolTipTextNeededEventArgs that contains the event data.
OnVisibleChanged(EventArgs)
Raises the VisibleChanged event.
OnWm_SettingChange(Message)
Handles the WM_SETTINGCHANGE message to detect Windows theme changes.
Declaration
protected virtual void OnWm_SettingChange(Message m)
Parameters
m
The Windows message.
PerformDesignModeLocationCorrection(ref Message)
Performs design mode location correction for the form.
Declaration
protected virtual void PerformDesignModeLocationCorrection(ref Message msg)
Parameters
msg
The Windows message to process.
ProcessCaptureChangeRequested(RadElement, bool)
Processes a capture request from the specified element.
Declaration
protected virtual bool ProcessCaptureChangeRequested(RadElement element, bool capture)
Parameters
element
The element which requested the capture.
capture
True to capture; otherwise, false.
Returns
True if the capture request is approved; otherwise, false.
ProcessDialogKey(Keys)
Processes a dialog box key.
Declaration
protected override bool ProcessDialogKey(Keys keyData)
Parameters
keyData
One of the Keys values that represents the key to process.
Returns
true if the keystroke was processed and consumed by the control; otherwise, false to allow further processing.
Overrides
ProcessFocusRequested(RadElement)
Processes a focus request from the specified element.
Declaration
protected virtual bool ProcessFocusRequested(RadElement element)
Parameters
element
The element that requested the focus.
Returns
True if focus is approved; otherwise, false.
RegisterHostedControl(RadHostItem)
Registers a hosted control with this form.
Declaration
public void RegisterHostedControl(RadHostItem hostElement)
Parameters
hostElement
The host element containing the control to register.
Implements
ResetFormBehavior(bool)
Resets the behavior associated with the Form. This method is used internally.
Declaration
public void ResetFormBehavior(bool callInitialize)
Parameters
callInitialize
True to call the InitializeFormBehavior method after resetting; otherwise, false.
ResumeDpiScaling()
Resumes DPI scaling operations.
Declaration
public void ResumeDpiScaling()
ResumeUpdate()
Resumes the painting of the control.
Declaration
public void ResumeUpdate()
Implements
ResumeUpdate(bool)
Resumes the painting of the control.
Declaration
public void ResumeUpdate(bool invalidate)
Parameters
invalidate
True to invalidate the control when resuming; otherwise, false.
ScaleControl(SizeF, BoundsSpecified)
Scales the control's location, size, and other properties.
Declaration
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
Parameters
factor
The scaling factor.
specified
Which bounds to scale.
Overrides
SetBoundsCore(int, int, int, int, BoundsSpecified)
Performs the work of setting the specified bounds of this control.
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
x
The new Left property value of the control.
y
The new Top property value of the control.
width
The new Width property value of the control.
height
The new Height property value of the control.
specified
A bitwise combination of the BoundsSpecified values.
Overrides
SetClientSizeCore(int, int)
Sets the size of the client area of the form.
SetIconPrimitiveVisibility(bool)
Declaration
protected abstract void SetIconPrimitiveVisibility(bool visible)
Parameters
visible
ShouldSerializeProperty(RadProperty)
Determines whether the specified RadProperty should be serialized.
Declaration
protected virtual bool ShouldSerializeProperty(RadProperty property)
Parameters
property
The property to check for serialization.
Returns
True if the property should be serialized; otherwise, false.
SuspendDpiScaling()
Suspends DPI scaling operations.
Declaration
public void SuspendDpiScaling()
SuspendUpdate()
Suspends the painting of the control.
Declaration
public void SuspendUpdate()
Implements
UnregisterHostedControl(RadHostItem, bool)
Unregisters a hosted control from this form.
Declaration
public void UnregisterHostedControl(RadHostItem hostElement, bool removeControl)
Parameters
hostElement
The host element containing the control to unregister.
removeControl
True to remove the control from the Controls collection; otherwise, false.
Implements
UpdateDefaultButton()
Updates which button is the default button.
Declaration
protected override void UpdateDefaultButton()
Overrides
WndProc(ref Message)
Processes Windows messages.
Events
Initialized
Occurs when the component's initialization is complete.
Declaration
public event EventHandler Initialized
Event Value
Implements
PropertyChanged
Occurs when a property of an object changes. Calling the event is developer's responsibility.
Declaration
[Browsable(false)]
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements
ScreenTipNeeded
Occurs prior to the ScreenTip of a RadItem instance inside the RadControl being displayed.
Declaration
public event ScreenTipNeededEventHandler ScreenTipNeeded
Event Value
ThemeNameChanged
Occurs when the theme name has changed.
Declaration
public event ThemeNameChangedEventHandler ThemeNameChanged
Event Value
Implements
ToolTipTextNeeded
Occurs when a RadItem instance inside the RadControl requires ToolTip text.
Declaration
public event ToolTipTextNeededEventHandler ToolTipTextNeeded
Event Value
Implements
WindowsThemeChanged
Occurs when the Windows theme is changed (to Light, Dark or HighContrast).
Declaration
public event WindowsThemeEventHandler WindowsThemeChanged
Event Value