RadFormBehavior
A standard behavior for RadForm.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadFormBehavior : ThemedFormBehavior, IComponent, IDisposable
Inheritance: objectMarshalByRefObjectComponentFormControlBehaviorThemedFormBehaviorRadFormBehavior...
Implements:
Inherited Members
Constructors
Creates an instance of the RadFormBehavior class. This instance has no Form associated with it.
public RadFormBehavior()
Creates an instance of the RadFormBehavior class.
public RadFormBehavior(IComponentTreeHandler treeHandler, bool shouldCreateChildren)
An IComponentTreeHandler instance.
shouldCreateChildrenboolA flag that determines whether the CreateChildItems call is rerouted to the behavior.
Creates an instance of the RadFormBehavior class.
public RadFormBehavior(IComponentTreeHandler treeHandler)
An IComponentTreeHandler instance.
Properties
Gets or sets a boolean value indicating whether the behavior paints in the NC area of the Form when OS is Vista or later and Composition is enabled.
public override bool AllowTheming { get; set; }
Overrides:
Gets the Border width of the Form.
public override Padding BorderWidth { get; }
Overrides:
Gets the Caption Height of the Form.
public override int CaptionHeight { get; }
Overrides:
Gets the bounds of the title-bar text element used to render the form caption.
public override Rectangle CaptionTextBounds { get; }
Overrides:
Gets the margin that determines the position and size of the client area of the Form.
public override Padding ClientMargin { get; }
Overrides:
Gets the element tree that renders the form frame and title bar.
public override RadElement FormElement { get; }
Overrides:
Gets the bounding rectangle of the horizontal scrollbar. Returns an empty rectangle if the scrollbar is not visible.
protected virtual Rectangle HorizontalScrollbarBounds { get; }
Gets the bounds of the title-bar icon element.
public override Rectangle IconBounds { get; }
Overrides:
Gets the bounds of the MDI control strip, which hosts the MDI child window buttons.
public override Rectangle MenuBounds { get; }
Overrides:
Gets the bounding rectangle of the sizing grip that appears when both scrollbars are visible.
protected virtual Rectangle ScrollbarSizingGripBounds { get; }
Gets the bounds of the title-bar system buttons.
public override Rectangle SystemButtonsBounds { get; }
Overrides:
Gets the bounding rectangle of the vertical scrollbar. Returns an empty rectangle if the scrollbar is not visible.
protected virtual Rectangle VerticalScrollbarBounds { get; }
Methods
This method adjusts the FormElement according to the styles currently applied to the Form. For example, the MinimizeButton, MaximizeButton and CloseButton in the Title Bar are enabled/disabled according to whether the corresponding window style is applied.
protected void AdjustFormElementForCurrentStyles()
Changes the visibility of the separate items within the RadFormElement's element tree according to the current Form state.
protected void AdjustFormElementForFormState(int? formState)
The state of the Form as it comes from the WM_SIZE message
Calculates the client margin based on the current form and form element settings
Creates the form element, synchronizes its caption, and connects its title-bar buttons and scrollbars to the form.
public override void CreateChildItems(RadElement parent)
The element that receives the form element.
Overrides:
Creates the element tree used to render a RadForm.
Adjusts native window styles to match the form's box, taskbar, and border settings, and removes native scrollbar styles because scrolling is rendered by the form element.
public override CreateParams CreateParams(CreateParams parameters)
The native window parameters to adjust.
Returns:The adjusted window parameters.
Overrides:
Gets the Caption Height according to the Styles applied and the current state of the form.
protected virtual int GetDynamicCaptionHeight()
A value representing the height of the caption.
Gets a Padding object which represents the window NC margin according to the currently set styles.
Routes non-client hit testing, mouse, activation, style, icon, text, and menu messages to the form element. When theming is enabled, unhandled messages are passed to the base handler. When it is disabled, the method returns false for ordinary messages but still handles non-MDI hit testing.
Invalidates the corresponding non-client area instead of the client-area element bounds.
public override void InvalidateElement(RadElement element, Rectangle bounds)
The element that changed.
boundsRectangleThe element bounds to invalidate.
Overrides:
This method translates a point which is in client coordinates to a point in NC coordinates. Used when the Form has captured the mouse and NC mouse events have to be processed.
Updates the custom title-bar text after the active MDI child text changes.
protected override void OnActiveMDIChildTextChanged()
Overrides:
Fires when a Form has been associated with the behavior.
protected override void OnFormAssociated()
Overrides:
Calculates the bounding rectangle of the horizontal scrollbar.
protected virtual Rectangle SynchronizeHorizontalScrollbarState()
An instance of the Rectangle struct that represents the position and the size of the horizontal scrollbar.
This method synchronizes the values of the standard horizontal scrollbar with the RadScrollBarElement in the Form's element hierarchy.
protected virtual void SynchronizeHorizontalScrollbarValues()
Recalculates the form layout and copies the native scrollbar ranges and values into the element scrollbars.
protected void SynchronizeScrollbarsValues()
Calculates the bounding rectangle of the vertical scrollbar.
protected virtual Rectangle SynchronizeVerticalScrollbarState()
An instance of the Rectangle struct that represents the position and the size of the vertical scrollbar
This method synchronizes the values of the standard vertical scrollbar with the RadScrollBarElement in the Form's element hierarchy.
protected virtual void SynchronizeVerticalScrollbarValues()