ClassRadControl
Serves as the foundational base class for all Telerik WinControls, bridging the Windows Forms framework with the Telerik Presentation Framework (TPF) element-based architecture.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class RadControl : ScrollableControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControl
Derived Classes:
Implements:
Inherited Members
Constructors
RadControl()
Declaration
public RadControl()
Fields
Properties
AllowShowFocusCues
Indicates focus cues display, when available, based on the corresponding control type and the current UI state.
Declaration
[Browsable(true)]
public virtual bool AllowShowFocusCues { get; set; }
Property Value
AnalyticsName
Gets or sets the Analytics Name associated with this control. By default the Control Name property is logged. If you want to customize the information which will be logged for this control set this property to a preferred value.
Declaration
[Browsable(false)]
public virtual string AnalyticsName { get; set; }
Property Value
Implements
AutoSize
Gets or sets a value indicating whether the control is automatically resized to display its entire contents.
Declaration
[Browsable(true)]
public override bool AutoSize { get; set; }
Property Value
Overrides
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 input behavior for the control.
Declaration
[Browsable(false)]
public ComponentInputBehavior Behavior { get; }
Property Value
CausesValidation
Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus.
CommandBindings
Declaration
[TypeConverter(typeof(ExpandableObjectConverter))]
public InputBindingsCollection CommandBindings { get; }
Property Value
ElementTree
Declaration
[Browsable(false)]
public virtual ComponentThemableElementTree ElementTree { get; }
Property Value
EnableAnalytics
Gets or sets a value indicating whether the Analytics functionality is enabled or disabled for this control.
Declaration
[Browsable(true)]
public virtual bool EnableAnalytics { get; set; }
Property Value
Implements
EnableCodedUITests
Gets or sets a value indicating whether the CodedUI Tests functionality is enabled.
Declaration
[Browsable(true)]
public virtual bool EnableCodedUITests { get; set; }
Property Value
EnableCodedUITestsDefaultValue
Gets or sets the default value for EnableCodedUITests property.
Declaration
[Browsable(true)]
public static bool EnableCodedUITestsDefaultValue { get; set; }
Property Value
EnableDpiScaling
Gets or sets a value indicating whether the RadControls scaling logic will be used when the application is run in a high DPI environment.
EnableImageDpiScaling
Gets or sets a value indicating whether the RadControls scaling logic will be used to resize the images when the application is run in a high DPI environment.
Declaration
public static bool EnableImageDpiScaling { get; set; }
Property Value
EnableKeyMap
Gets or sets whether 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 virtual bool EnableKeyMap { get; set; }
Property Value
EnableRadAccessibilityObjects
Gets or sets a value indicating whether the RadControls Accessible custom object is enabled.
Declaration
[Browsable(false)]
public virtual bool EnableRadAccessibilityObjects { get; set; }
Property Value
EnableRadAutoScale
Gets or sets a value that indicates whether to use the new auto-scaling mechanism or not. Enabled by default.
Declaration
public static bool EnableRadAutoScale { get; set; }
Property Value
EnableRadFormInitialDpiScaling
Do not modify. For internal use only.
Declaration
public static bool EnableRadFormInitialDpiScaling { get; set; }
Property Value
EnableSvgImages
Gets or sets a value indicating whether the RadControls will draw use the SvgImages in ImagePrimitive and LightVisualElement objects, or if [false] will draw the corresponding Image property if applicable.
EnableTheming
Gets or sets value indicating whether the control is styled through theme
EnableUIAutomation
Gets or sets a value indicating whether the UI Automation functionality is enabled.
Declaration
[Browsable(true)]
public virtual bool EnableUIAutomation { get; set; }
Property Value
EnableUIAutomationDefaultValue
Gets or sets the default value for EnableUIAutomation property.
Declaration
[Browsable(true)]
public static bool EnableUIAutomationDefaultValue { get; set; }
Property Value
FocusedElement
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
ImageList
Gets or sets the ImageList that contains the images displayed by this control.
Declaration
[Browsable(true)]
public virtual ImageList ImageList { get; set; }
Property Value
Implements
ImageScalingSize
Gets or sets the image scaling size.
Declaration
[Browsable(false)]
public Size ImageScalingSize { get; set; }
Property Value
Implements
IsDesignMode
Declaration
[Browsable(false)]
public bool IsDesignMode { get; }
Property Value
IsDisplayed
Determines whether the control is currently displayed on the screen.
Declaration
[Browsable(false)]
public bool IsDisplayed { get; }
Property Value
IsInitializing
Declaration
[Browsable(false)]
public bool IsInitializing { get; }
Property Value
IsLoaded
Determines whether the control is properly loaded.
MaximumSize
Gets or sets the size that is the upper limit that GetPreferredSize can specify.
Declaration
public override Size MaximumSize { get; set; }
Property Value
Overrides
MinimumSize
Gets or sets the size that is the lower limit that GetPreferredSize can specify
Declaration
public override Size MinimumSize { get; set; }
Property Value
Overrides
Padding
Gets or sets padding within the control.
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
Declaration
public override ISite Site { get; set; }
Property Value
Overrides
SmallImageList
Gets or sets the SmallImageList that contains the small images which are displayed when there's not enough space.
Declaration
[Browsable(true)]
public virtual ImageList SmallImageList { get; set; }
Property Value
Implements
SmallImageScalingSize
Gets or sets the small image scaling size.
Declaration
[Browsable(false)]
public Size SmallImageScalingSize { get; set; }
Property Value
Implements
Text
Declaration
[Browsable(true)]
[Bindable(true)]
[SettingsBindable(true)]
public override string Text { get; set; }
Property Value
Overrides
ThemeClassName
Gets or sets the class name string that ThemeResolutionService will use to find the themes registered for the control.
Declaration
public virtual string ThemeClassName { get; set; }
Property Value
Remarks
By default the return value is RadControl's type FullName; Some controls like drop down menu has different ThemeClassName depending on the runtime usage of the control.
ThemeName
Gets or sets control's preferred theme name. Themes are stored and retrieved using APIs of ThemeResolutionService.
Declaration
[Browsable(true)]
public virtual string ThemeName { get; set; }
Property Value
Implements
Remarks
If ThemeResolutionService.ApplicatonThemeName refers to a non-empty string, the theme of a RadControl can differ from the one set using RadControls.ThemeName property. If the themes differ, the RadControls.ThemeName property will be overridden by ThemeResolutionService.ApplicatonThemeName. If no theme is registered with a name as ThemeResolutionService.ApplicatonThemeName, then control will revert to the theme specified by its ThemeName property. If ThemeName is assigned to a non-existing theme name, the control may have no visual properties assigned, which will cause it look and behave in unexpected manner. If ThemeName equals empty string, control's theme is set to a theme that is registered within ThemeResolutionService with the name "ControlDefault".
UseCompatibleTextRendering
Determines whether to use compatible text rendering engine (GDI+) or not (GDI).
Declaration
public virtual bool UseCompatibleTextRendering { get; set; }
Property Value
UseCompatibleTextRenderingDefaultValue
Set or get the default value for UseCompatibleTextRendering property.
Declaration
public static bool UseCompatibleTextRenderingDefaultValue { get; set; }
Property Value
Methods
BeginInit()
Suspends layout during initialization.
Declaration
public virtual void BeginInit()
Implements
CanEditElementAtDesignTime(RadElement)
Determines whether an element may be edited via the EditUIElements dialog at design-time.
Declaration
protected virtual bool CanEditElementAtDesignTime(RadElement element)
Parameters
element
Returns
Construct()
Declaration
protected virtual void Construct()
CreateBehavior()
Creates the input behavior instance. Allows inheritors to provide custom input implementations.
Declaration
protected virtual ComponentInputBehavior CreateBehavior()
Returns
CreateChildItems(RadElement)
Declaration
protected virtual void CreateChildItems(RadElement parent)
Parameters
parent
CreateRootElement()
Declaration
protected virtual RootRadElement CreateRootElement()
Returns
DisableGesture(GestureType)
Disable firing gesture events of the specified type.
Declaration
public void DisableGesture(GestureType type)
Parameters
type
The type of gesture events to disable.
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
Overrides
EnableGesture(GestureType)
Enable firing gesture events of the specified type.
Declaration
public void EnableGesture(GestureType type)
Parameters
type
The type of gesture events to enable.
FindPropertyInChildren(RadControl, IPCMessage)
Declaration
protected virtual bool FindPropertyInChildren(RadControl radControl, IPCMessage request)
Parameters
radControl
request
IPCMessage
Returns
GetMonitorDpiScaleFactor(Control)
Gets the DPI scale factor for the monitor where the specified control is currently displayed.
Declaration
protected virtual SizeF GetMonitorDpiScaleFactor(Control control)
Parameters
control
The control used to determine which monitor to query for DPI information.
Returns
A SizeF representing the DPI scale factor where both Width and Height contain the same scaling value (e.g., 1.25 for 125% scaling, 1.5 for 150% scaling).
Remarks
This method is used by the RadAutoScale system to determine the target DPI scaling that should be applied to the control. It queries the Windows DPI awareness system to get the effective DPI for the window handle and converts it to a scale factor relative to the standard 96 DPI.
The method is virtual to allow derived controls to customize DPI detection behavior if needed, such as for specialized hosting scenarios or custom DPI handling requirements.
This method requires Windows 10 Anniversary Update (1607) or later for per-monitor DPI awareness support. On earlier versions, the system falls back to other DPI detection methods.
GetPlainText()
Strips all html tags of the text set to the control and returns only the plain text.
Declaration
public string GetPlainText()
Returns
Plain text stripped of any html tags.
InitializeRootElement(RootRadElement)
Declaration
protected virtual void InitializeRootElement(RootRadElement rootElement)
Parameters
rootElement
InvokeLayoutCallback(LayoutCallback)
Declaration
public void InvokeLayoutCallback(LayoutCallback callback)
Parameters
callback
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)
Declaration
protected override void OnAutoSizeChanged(EventArgs e)
Parameters
e
Overrides
OnBackColorChanged(EventArgs)
Declaration
protected override void OnBackColorChanged(EventArgs e)
Parameters
e
Overrides
OnBindingContextChanged(EventArgs)
Declaration
protected override void OnBindingContextChanged(EventArgs e)
Parameters
e
Overrides
OnCaptureLosing()
Declaration
protected virtual void OnCaptureLosing()
OnClick(EventArgs)
Declaration
protected override void OnClick(EventArgs e)
Parameters
e
Overrides
OnCreateControl()
Declaration
protected override void OnCreateControl()
Overrides
OnDoubleClick(EventArgs)
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
e
Overrides
OnEnabledChanged(EventArgs)
Declaration
protected override void OnEnabledChanged(EventArgs e)
Parameters
e
Overrides
OnFontChanged(EventArgs)
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
e
Overrides
OnForeColorChanged(EventArgs)
Declaration
protected override void OnForeColorChanged(EventArgs e)
Parameters
e
Overrides
OnGesture(GestureEventArgs)
Declaration
protected virtual void OnGesture(GestureEventArgs args)
Parameters
args
OnGotFocus(EventArgs)
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
e
Overrides
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
e
Overrides
OnInvalidated(RadElement)
Declaration
protected virtual void OnInvalidated(RadElement element)
Parameters
element
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
Overrides
OnKeyPress(KeyPressEventArgs)
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
e
Overrides
OnKeyUp(KeyEventArgs)
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
e
Overrides
OnLayout(LayoutEventArgs)
Declaration
protected override void OnLayout(LayoutEventArgs e)
Parameters
e
Overrides
OnLoad(Size)
Notifies that the control is about to be visualized.
Declaration
protected virtual void OnLoad(Size desiredSize)
Parameters
desiredSize
OnLocationChanged(EventArgs)
Declaration
protected override void OnLocationChanged(EventArgs e)
Parameters
e
Overrides
OnLostFocus(EventArgs)
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
e
Overrides
OnMouseCaptureChanged(EventArgs)
Declaration
protected override void OnMouseCaptureChanged(EventArgs e)
Parameters
e
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
Overrides
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
e
Overrides
OnMouseHover(EventArgs)
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
e
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
e
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
e
Overrides
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
e
Overrides
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Declaration
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
OnNotifyPropertyChanged(string)
Raises the PropertyChanged event
Declaration
protected virtual void OnNotifyPropertyChanged(string propertyName)
Parameters
propertyName
The name of the property
OnPaddingChanged(EventArgs)
Declaration
protected override void OnPaddingChanged(EventArgs e)
Parameters
e
Overrides
OnPaint(PaintEventArgs)
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
e
Overrides
OnPanGesture(PanGestureEventArgs)
Fires the PanGesture event.
Declaration
protected virtual void OnPanGesture(PanGestureEventArgs args)
Parameters
args
The arguments for the PanGesture event.
OnParentChanged(EventArgs)
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
e
Overrides
OnPressAndTapGesture(PressAndTapGestureEventArgs)
Fires the PressAndTapGesture event.
Declaration
protected virtual void OnPressAndTapGesture(PressAndTapGestureEventArgs args)
Parameters
args
The arguments for the PressAndTapGesture event.
OnPreviewKeyDown(PreviewKeyDownEventArgs)
Declaration
protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
Parameters
e
Overrides
OnRightToLeftChanged(EventArgs)
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
e
Overrides
OnRotateGesture(RotateGestureEventArgs)
Fires the RotateGesture event.
Declaration
protected virtual void OnRotateGesture(RotateGestureEventArgs args)
Parameters
args
The arguments for the RotateGesture event.
OnScreenTipNeeded(object, ScreenTipNeededEventArgs)
Declaration
protected virtual void OnScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
Parameters
sender
e
OnThemeChanged()
Declaration
protected virtual void OnThemeChanged()
OnThemeNameChanged(ThemeNameChangedEventArgs)
Declaration
protected virtual void OnThemeNameChanged(ThemeNameChangedEventArgs e)
Parameters
e
OnToolTipTextNeeded(object, ToolTipTextNeededEventArgs)
Declaration
protected virtual void OnToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
Parameters
sender
e
OnTwoFingerTapGesture(GestureEventArgs)
Fires the TwoFingerTapGesture event.
Declaration
protected virtual void OnTwoFingerTapGesture(GestureEventArgs args)
Parameters
args
The arguments for the TwoFingerTapGesture event.
OnVisibleChanged(EventArgs)
Declaration
protected override void OnVisibleChanged(EventArgs e)
Parameters
e
Overrides
OnZoomGesture(ZoomGestureEventArgs)
Fires the ZoomGesture event.
Declaration
protected virtual void OnZoomGesture(ZoomGestureEventArgs args)
Parameters
args
The arguments for the ZoomGesture event.
PerformRadAutoScale(BoundsSpecified?)
Performs auto scaling of the control.
Declaration
protected virtual void PerformRadAutoScale(BoundsSpecified? specified = null)
Parameters
specified
ProcessAutoSizeChanged(bool)
Declaration
protected virtual void ProcessAutoSizeChanged(bool value)
Parameters
value
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
Returns
True if the capture request is approved, otherwise false.
ProcessCodedUIMessage(ref IPCMessage)
Declaration
protected virtual void ProcessCodedUIMessage(ref IPCMessage request)
Parameters
request
IPCMessage
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, false otherwise.
Refresh()
Declaration
public override void Refresh()
Overrides
RegisterHostedControl(RadHostItem)
Declaration
public virtual void RegisterHostedControl(RadHostItem hostElement)
Parameters
hostElement
Implements
ResetBackColorThemeOverrides()
Declaration
protected virtual void ResetBackColorThemeOverrides()
ResetForeColorThemeOverrides()
Declaration
protected virtual void ResetForeColorThemeOverrides()
ResetProperty(RadProperty, RadObject)
Reset the property to its default value.
Declaration
protected virtual void ResetProperty(RadProperty property, RadObject element)
Parameters
property
The RadProperty to be reset.
element
The RadObject owner of the property.
ResolveStyleGroupForElement(StyleGroup, RadObject)
Replaces the default style group for specific element.
Declaration
public virtual StyleGroup ResolveStyleGroupForElement(StyleGroup styleGroup, RadObject element)
Parameters
styleGroup
The style group to replace.
element
The element on which this style should apply.
Returns
An instance of StyleGroup is successfull.
ResumeUpdate()
Declaration
public void ResumeUpdate()
Implements
ScaleControl(SizeF, BoundsSpecified)
Declaration
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
Parameters
factor
specified
Overrides
SetBackColorThemeOverrides()
Declaration
protected virtual void SetBackColorThemeOverrides()
SetBoundsCore(int, int, int, int, BoundsSpecified)
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
x
y
width
height
specified
Overrides
SetForeColorThemeOverrides()
Declaration
protected virtual void SetForeColorThemeOverrides()
SetRadAutoScale(bool)
Enables/disables RadAutoScale. If you want to disable RadAutoScale for this control, call this method immediately after creating the control.
ShouldSerializeProperty(RadProperty)
Determines whether the specified RadProperty should be serialized.
Declaration
protected virtual bool ShouldSerializeProperty(RadProperty property)
Parameters
property
The RadProperty that is about to be serialized.
Returns
A value indicating whether to serialize the property value.
ShouldSerializeProperty(RadProperty, RadObject)
Determines whether the specified RadProperty should be serialized. Prevents theme and default values serialization.
Declaration
protected virtual bool ShouldSerializeProperty(RadProperty property, RadObject element)
Parameters
property
The RadProperty that is about to be serialized.
element
The element that owns the property.
Returns
A value indicating whether to serialize the property value.
SuspendUpdate()
Declaration
public void SuspendUpdate()
Implements
UnregisterHostedControl(RadHostItem, bool)
Declaration
public virtual void UnregisterHostedControl(RadHostItem hostElement, bool removeControl)
Parameters
hostElement
removeControl
Implements
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message m)
Parameters
m
Overrides
Events
Initialized
Fires when the control is initialized.
Declaration
public event EventHandler Initialized
Event Value
Implements
PanGesture
Occurs when a pan gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event PanGestureEventHandler PanGesture
Event Value
PressAndTapGesture
Occurs when a press-and-tap gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event PressAndTapGestureEventHandler PressAndTapGesture
Event Value
PropertyChanged
Occurs when a property of an object changes change. Calling the event is developer's responsibility.
Declaration
[Browsable(false)]
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements
RotateGesture
Occurs when a rotate gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event RotateGestureEventHandler RotateGesture
Event Value
ScreenTipNeeded
Occurs prior the ScreenTip of a RadItem instance inside the RadControl is displayed.
Declaration
public virtual event ScreenTipNeededEventHandler ScreenTipNeeded
Event Value
ThemeNameChanged
Fires when the theme name is changed.
Declaration
public event ThemeNameChangedEventHandler ThemeNameChanged
Event Value
Implements
ToolTipTextNeeded
Occurs when a RadItem instance inside the RadControl requires ToolTip text.
Declaration
public virtual event ToolTipTextNeededEventHandler ToolTipTextNeeded
Event Value
Implements
TwoFingerTapGesture
Occurs when a two-finger-tap gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event GestureEventHandler TwoFingerTapGesture
Event Value
ZoomGesture
Occurs when a zoom gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event ZoomGestureEventHandler ZoomGesture
Event Value