Class Control
Control handled by the operating system. It is not suggested to create Control directly.
public class Control : AbstractControl, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, ILayoutItem, INotifyDataErrorInfo
- Inheritance
-
Control
- Implements
- Derived
Constructors
- Control()
Initializes a new instance of the AbstractControl class.
- Control(Control)
Initializes a new instance of the AbstractControl class.
Fields
- Empty
Gets an empty control for use in the different places. Do not change any properties of this control.
Properties
- AllowDefaultContextMenu
Gets or sets a value indicating whether the default context menu is allowed for this control. The default value is
true. This property is relevant for native controls that have a default context menu provided by the operating system. When set tofalse, right-clicking with the mouse does not forward the event to the native control, preventing the default context menu from appearing.
- AllowDrop
Gets or sets a value indicating whether the control can accept data that the user drags onto it.
- BackgroundStyle
Gets or sets the background style of the control.
- BorderStyle
Gets or sets border style of the control.
- Bounds
Gets or sets the AbstractControl bounds relative to the parent, in device-independent units.
- BoundsInPixels
Gets or sets bounds in pixels. You should not normally use this property unless this control is a top level window.
- CanSelect
Gets or sets value indicating whether this control accepts input or not (i.e. behaves like a static text) and so doesn't need focus.
- ClientSize
Gets or sets size of the AbstractControl's client area, in device-independent units.
- Cursor
Gets or sets the cursor that the control should normally display.
- Focused
Gets a value indicating whether the control has input focus.
- Handler
Gets a IControlHandler associated with this class.
- HasBorder
Gets or sets a value indicating whether the control has a border.
- IsGraphicControl
Gets whether control is graphic control. Graphic controls can not be selected using mouse, do not accept focus and ignore keyboard.
- IsHandleCreated
Gets a value indicating whether the control has a native window handle associated with it.
- IsMouseCaptured
Gets a value indicating whether the mouse is captured to this control.
- IsPlatformControl
Gets whether this is control has handler to the platform control.
- IsScrollable
Gets or sets whether controls is scrollable. This makes sense only for UserControl descendants.
- LangDirection
Gets or sets the language direction for this control.
- NativeControl
Gets native control instance.
- NativePadding
Gets auto padding of the native control.
- RealBackgroundColor
Gets real background color for the control.
- RealForegroundColor
Gets real foreground color for the control.
- RenderingFlags
Gets or sets the rendering flags that determine how the control is rendered.
- SafeHandler
Gets a IControlHandler associated with this class or Null if control is disposed.
- Text
Gets or sets the text associated with this control.
- UserPaint
Gets or set a value indicating whether the control paints itself rather than the operating system doing so.
- Visible
Gets or sets a value indicating whether the control and all its child controls are displayed.
- VisibleOnScreen
Gets whether control is visible on screen.
Methods
- BeginInit()
Starts the initialization process for this control.
- BeginUpdate()
Maintains performance while performing slow operations on a control by preventing the control from drawing until the EndUpdate() method is called.
- CaptureMouse()
Captures the mouse to the control.
- ClientToScreen(PointD)
Converts the client-area coordinates of a specified point to screen coordinates.
- CreateDrawingContext()
Creates the Graphics for the control.
- CreateHandler()
Creates a handler for the control.
- DetachHandler()
Disconnects the current control Handler from the control. This method calls Detach().
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- DoDragDrop(object, DragDropEffects)
Begins a drag-and-drop operation.
- EndInit()
Ends the initialization process for this control.
- EndUpdate()
Resumes painting the control after painting is suspended by the BeginUpdate() method.
- EnsureHandlerCreated()
Ensures that the control Handler is created, creating and attaching it if necessary.
- GetBestSizeWithoutPadding(PreferredSizeContext)
Gets size of the native control without padding.
- GetDefaultAttributesBgColor()
Gets background color from the default attributes.
- GetDefaultAttributesFgColor()
Gets foreground color from the default attributes.
- GetDefaultAttributesFont()
Gets font from the default attributes.
- GetHandle()
Gets native handle of the control. On WxWidgets platform returns pointer to the native control. For Windows returns hWnd, for macOs returns pointer to NSView, for Linux GTK returns pointer to GtkWidget. For other operating systems returns Zero.
- GetScrollBarInfo(bool)
Gets vertical or horizontal scrollbar position as ScrollBarInfo.
- GetUpdateClientRect()
Gets the update rectangle region bounding box in client coordinates. This method can be used in paint events. Returns rectangle in device-independent units.
- GetUpdateClientRectI()
Gets the update rectangle region bounding box in client coordinates. This method can be used in paint events. Returns rectangle in pixels.
- HandleNeeded()
Creates native control if its not already created.
- HideToolTip()
Hides tooltip if it is visible. This method doesn't change ToolTip property.
- InternalSetColor(bool, Color?)
Sets internal color.
- Invalidate()
Invalidates the control and causes a paint message to be sent to the control.
- InvalidateBestSize()
Resets the cached best size value so it will be recalculated the next time it is needed.
- IsTransparentBackgroundSupported()
Checks whether using transparent background might work.
- OnFontChanged(EventArgs)
Called when the value of the Font property changes.
- OnMouseEnter(EventArgs)
Called when the mouse pointer enters the control.
- OnMouseLeave(EventArgs)
Called when the mouse pointer leaves the control.
- OnMouseMove(MouseEventArgs)
Called when the mouse is moved.
- OnSystemColorsChanged(EventArgs)
Called when the SystemColorsChanged event is raised.
- OnTextChanged(EventArgs)
Called when the TextChanged event is raised.
- OnToolTipChanged(EventArgs)
Raises the ToolTipChanged event.
- RaiseBackgroundColorChanged()
Called after background color changed.
- RaiseChildInserted(int, AbstractControl)
Raises the ChildInserted event and OnChildInserted(int, AbstractControl) method.
- RaiseChildRemoved(AbstractControl)
Raises the ChildRemoved event and OnChildRemoved(AbstractControl) method.
- RaiseEnabledChanged(EventArgs)
Raises the EnabledChanged event and calls OnEnabledChanged(EventArgs).
- RaiseHandleCreated(EventArgs)
Raises the HandleCreated event and OnHandleCreated(EventArgs) method.
- RaiseHandlerTextChanged(string)
Called when handler's text property is changed.
- RaiseVisibleChanged(EventArgs)
Raises VisibleChanged event and OnVisibleChanged(EventArgs) method.
- RecreateHandler()
Forces the re-creation of the handler for the control.
- RecreateWindow()
Forces the re-creation of the underlying native control.
- RefreshRect(RectD, bool)
Same as Invalidate(RectD) but has additional parameter
eraseBackground.
- ReleaseMouseCapture()
Releases the mouse capture, if the control held the capture.
- RequestScaleFactor()
Requests scale factor from the parent or other available sources.
- RequireHandler(AbstractControl?)
Gets IControlHandler for the control if it is possible.
- ResumeHandlerTextChange()
Resumes live binding between native control's Text and control's Text.
- ScreenToClient(PointD)
Converts the screen coordinates of a specified point on the screen to client-area coordinates.
- SetFocus()
Sets input focus to the control.
- SetScrollBarInfo(bool, ScrollBarInfo)
Sets vertical or horizontal scrollbar position as ScrollBarInfo.
- SuspendHandlerTextChange()
Suspends live binding between native control's Text and control's Text.
- Update()
Causes the control to redraw the invalidated regions.
- UpdateCursor(Cursor?)
Updates cursor and call's SetCursor(Cursor?).
- UpdateFocusFlags(bool, bool)
Updates focus related flags.