RadControl
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
public RadControl()
Fields
protected Rectangle invalidResizeRect
protected bool isAccessibilityRequested
protected bool isDisposing2
protected bool isResizing2
Properties
Indicates focus cues display, when available, based on the corresponding control type and the current UI state.
[Browsable(true)]
public virtual bool AllowShowFocusCues { get; set; }
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.
[Browsable(false)]
public virtual string AnalyticsName { get; set; }
Implements:
Gets or sets a value indicating whether the control is automatically resized to display its entire contents.
[Browsable(true)]
public override bool AutoSize { get; set; }
Overrides:
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 input behavior for the control.
[Browsable(false)]
public ComponentInputBehavior Behavior { get; }
Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus.
public bool CausesValidation { get; set; }
[TypeConverter(typeof(ExpandableObjectConverter))]
public InputBindingsCollection CommandBindings { get; }
[Browsable(false)]
public virtual ComponentThemableElementTree ElementTree { get; }
Gets or sets a value indicating whether the Analytics functionality is enabled or disabled for this control.
[Browsable(true)]
public virtual bool EnableAnalytics { get; set; }
Implements:
Gets or sets a value indicating whether the CodedUI Tests functionality is enabled.
[Browsable(true)]
public virtual bool EnableCodedUITests { get; set; }
Gets or sets the default value for EnableCodedUITests property.
[Browsable(true)]
public static bool EnableCodedUITestsDefaultValue { get; set; }
Gets or sets a value indicating whether the RadControls scaling logic will be used when the application is run in a high DPI environment.
public static bool EnableDpiScaling { get; set; }
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.
public static bool EnableImageDpiScaling { get; set; }
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.
[Browsable(true)]
public virtual bool EnableKeyMap { get; set; }
Gets or sets a value indicating whether the RadControls Accessible custom object is enabled.
[Browsable(false)]
public virtual bool EnableRadAccessibilityObjects { get; set; }
Gets or sets a value that indicates whether to use the new auto-scaling mechanism or not. Enabled by default.
public static bool EnableRadAutoScale { get; set; }
Do not modify. For internal use only.
public static bool EnableRadFormInitialDpiScaling { get; set; }
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.
public static bool EnableSvgImages { get; set; }
Gets or sets value indicating whether the control is styled through theme
public bool EnableTheming { get; set; }
Gets or sets a value indicating whether the UI Automation functionality is enabled.
[Browsable(true)]
public virtual bool EnableUIAutomation { get; set; }
Gets or sets the default value for EnableUIAutomation property.
[Browsable(true)]
public static bool EnableUIAutomationDefaultValue { get; set; }
[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 or sets the ImageList that contains the images displayed by this control.
[Browsable(true)]
public virtual ImageList ImageList { get; set; }
Implements:
Gets or sets the image scaling size.
[Browsable(false)]
public Size ImageScalingSize { get; set; }
Implements:
[Browsable(false)]
public bool IsDesignMode { get; }
Determines whether the control is currently displayed on the screen.
[Browsable(false)]
public bool IsDisplayed { get; }
[Browsable(false)]
public bool IsInitializing { get; }
Determines whether the control is properly loaded.
[Browsable(false)]
public bool IsLoaded { get; }
Gets or sets the size that is the upper limit that GetPreferredSize can specify.
public override Size MaximumSize { get; set; }
Overrides:
Gets or sets the size that is the lower limit that GetPreferredSize can specify
public override Size MinimumSize { get; set; }
Overrides:
Gets or sets padding within the control.
public Padding Padding { get; set; }
A Padding representing the control's internal spacing characteristics.
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 SmallImageList that contains the small images which are displayed when there's not enough space.
[Browsable(true)]
public virtual ImageList SmallImageList { get; set; }
Implements:
Gets or sets the small image scaling size.
[Browsable(false)]
public Size SmallImageScalingSize { get; set; }
Implements:
[Browsable(true)]
[Bindable(true)]
[SettingsBindable(true)]
public override string Text { get; set; }
Overrides:
Gets or sets the class name string that ThemeResolutionService will use to find the themes registered for the control.
public virtual string ThemeClassName { get; set; }
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.
Gets or sets control's preferred theme name. Themes are stored and retrieved using APIs of ThemeResolutionService.
[Browsable(true)]
public virtual string ThemeName { get; set; }
Implements:
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".
Determines whether to use compatible text rendering engine (GDI+) or not (GDI).
public virtual bool UseCompatibleTextRendering { get; set; }
Set or get the default value for UseCompatibleTextRendering property.
public static bool UseCompatibleTextRenderingDefaultValue { get; set; }
protected bool ValidationCancel { get; }
Methods
Suspends layout during initialization.
public virtual void BeginInit()
Implements:
Determines whether an element may be edited via the EditUIElements dialog at design-time.
protected virtual bool CanEditElementAtDesignTime(RadElement element)
protected virtual void Construct()
Creates the input behavior instance. Allows inheritors to provide custom input implementations.
Disable firing gesture events of the specified type.
public void DisableGesture(GestureType type)
The type of gesture events to disable.
Enable firing gesture events of the specified type.
public void EnableGesture(GestureType type)
The type of gesture events to enable.
Resumes layout.
public virtual void EndInit()
Implements:
protected virtual bool FindPropertyInChildren(RadControl radControl, IPCMessage request)
Gets the DPI scale factor for the monitor where the specified control is currently displayed.
protected virtual SizeF GetMonitorDpiScaleFactor(Control 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).
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.
Strips all html tags of the text set to the control and returns only the plain text.
protected virtual void InitializeRootElement(RootRadElement rootElement)
public void InvokeLayoutCallback(LayoutCallback callback)
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.
protected virtual void OnCaptureLosing()
protected override void OnCreateControl()
Overrides:
Notifies that the control is about to be visualized.
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Raises the PropertyChanged event
protected virtual void OnNotifyPropertyChanged(string propertyName)
The name of the property
Fires the PanGesture event.
protected virtual void OnPanGesture(PanGestureEventArgs args)
The arguments for the PanGesture event.
Fires the PressAndTapGesture event.
protected virtual void OnPressAndTapGesture(PressAndTapGestureEventArgs args)
The arguments for the PressAndTapGesture event.
protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
Overrides:
Fires the RotateGesture event.
protected virtual void OnRotateGesture(RotateGestureEventArgs args)
The arguments for the RotateGesture event.
protected virtual void OnScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
protected virtual void OnThemeChanged()
protected virtual void OnThemeNameChanged(ThemeNameChangedEventArgs e)
protected virtual void OnToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
Fires the TwoFingerTapGesture event.
protected virtual void OnTwoFingerTapGesture(GestureEventArgs args)
The arguments for the TwoFingerTapGesture event.
Fires the ZoomGesture event.
protected virtual void OnZoomGesture(ZoomGestureEventArgs args)
The arguments for the ZoomGesture event.
Performs auto scaling of the control.
protected virtual void PerformRadAutoScale(BoundsSpecified? specified = null)
Processes a capture request from the specified element.
protected virtual bool ProcessCaptureChangeRequested(RadElement element, bool capture)
The element which requested the capture.
captureboolReturns:True if the capture request is approved, otherwise false.
protected virtual void ProcessCodedUIMessage(ref IPCMessage request)
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, false otherwise.
public override void Refresh()
Overrides:
public virtual void RegisterHostedControl(RadHostItem hostElement)
Implements:
protected virtual void ResetBackColorThemeOverrides()
protected virtual void ResetForeColorThemeOverrides()
Reset the property to its default value.
protected virtual void ResetProperty(RadProperty property, RadObject element)
The RadProperty to be reset.
elementRadObjectThe RadObject owner of the property.
Replaces the default style group for specific element.
public virtual StyleGroup ResolveStyleGroupForElement(StyleGroup styleGroup, RadObject element)
The style group to replace.
elementRadObjectThe element on which this style should apply.
Returns:An instance of StyleGroup is successfull.
public void ResumeUpdate()
Implements:
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
Overrides:
protected virtual void SetBackColorThemeOverrides()
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Overrides:
protected virtual void SetForeColorThemeOverrides()
Enables/disables RadAutoScale. If you want to disable RadAutoScale for this control, call this method immediately after creating the control.
Determines whether the specified RadProperty should be serialized. Prevents theme and default values serialization.
protected virtual bool ShouldSerializeProperty(RadProperty property, RadObject element)
The RadProperty that is about to be serialized.
elementRadObjectThe element that owns the property.
Returns:A value indicating whether to serialize the property value.
Determines whether the specified RadProperty should be serialized.
protected virtual bool ShouldSerializeProperty(RadProperty property)
The RadProperty that is about to be serialized.
Returns:A value indicating whether to serialize the property value.
public void SuspendUpdate()
Implements:
public virtual void UnregisterHostedControl(RadHostItem hostElement, bool removeControl)
Implements:
Events
public event EventHandler ElementInvalidated
Fires when the control is initialized.
public event EventHandler Initialized
Implements:
Occurs when a pan gesture was sent by a touch input device.
[Browsable(true)]
public event PanGestureEventHandler PanGesture
Occurs when a press-and-tap gesture was sent by a touch input device.
[Browsable(true)]
public event PressAndTapGestureEventHandler PressAndTapGesture
Occurs when a property of an object changes change. Calling the event is developer's responsibility.
[Browsable(false)]
public event PropertyChangedEventHandler PropertyChanged
Implements:
Occurs when a rotate gesture was sent by a touch input device.
[Browsable(true)]
public event RotateGestureEventHandler RotateGesture
Occurs prior the ScreenTip of a RadItem instance inside the RadControl is displayed.
public virtual event ScreenTipNeededEventHandler ScreenTipNeeded
Fires when the theme name is changed.
public event ThemeNameChangedEventHandler ThemeNameChanged
Implements:
Occurs when a RadItem instance inside the RadControl requires ToolTip text.
public virtual event ToolTipTextNeededEventHandler ToolTipTextNeeded
Implements:
Occurs when a two-finger-tap gesture was sent by a touch input device.
[Browsable(true)]
public event GestureEventHandler TwoFingerTapGesture
Occurs when a zoom gesture was sent by a touch input device.
[Browsable(true)]
public event ZoomGestureEventHandler ZoomGesture