WinControl#

Qualified name: delphivcl.WinControl

class WinControl#

Bases: Control

TWinControl is the base class for all controls that are wrappers for Microsoft Windows screen objects. TWinControl provides the common functionality for all controls that act as wrappers for Microsoft Windows screen objects (“windows”). Controls that are wrap underlying windows have the following features:

The control can incorporate the functionality of an underlying window. For example, if the underlying screen object is a text editor, the control can incorporate the editor ability to manage and display a text buffer. The control can receive user input focus. The focused control can handle keyboard input events. Some controls change their appearance when they have the focus. For example, button controls typically indicate the focus by drawing a rectangle around the caption. The control can serve as a container for other controls, referred to as child controls. This relationship is signified by the child’s Parent property. Container controls provide important services to their children, including display services for controls that do not implement their own canvases. Examples of container controls include forms, panels, and toolbars. Controls based on TWinControl can display standard screen objects provided by Microsoft Windows, or customized screen objects developed by the VCL programmer. Descendants of TWinControl include abstract base classes that support most kinds of user interface objects. The most significant descendant is TCustomControl, which provides code to implement a canvas and handle paint messages. Other important abstract descendants include TScrollingWinControl, TButtonControl, TCustomComboBox, TCustomEdit, and TCustomListBox. When defining new control classes, consider these descendants before deriving directly from TWinControl. Every TWinControl object has a Handle property which provides the window handle for the underlying Microsoft Windows screen object. Use the Handle property to bypass the VCL API and directly access the underlying window.

Methods

Broadcast

Sends a message to each of the child controls.

CanFocus

Indicates whether a control can receive focus.

ContainsControl

Indicates whether a specified control exists within the control.

ControlAtPos

Returns the child control located at a specified position within the control.

Create

Creates an instance of TWinControl.

CreateParented

<Delphi method CreateParented of type TWinControl at 211418ED130>

CreateParentedControl

Creates and initializes a control as the child of a specified non-VCL window.

DefaultHandler

Provides message handling for all messages that the control does not fully process by itself.

Destroy

Destroys an instance of TWinControl.

DisableAlign

Disables the realignment of child controls.

DockDrop

Generates an OnDockDrop event.

EnableAlign

Decrements the reference count incremented by the DisableAlign method, eventually realigning the child controls.

FindChildControl

Returns a child control given its name.

FlipChildren

Reverses the positions of child controls.

Focused

Determines whether the control has input focus.

GetChildren

Calls a specified method for each child of the control.

GetTabControlList

Builds a list of owned controls.

GetTabOrderList

Builds a list of controls in tab order.

HandleAllocated

Reports whether a screen object handle exists for the control.

HandleNeeded

Creates a screen object for the control if it doesn't already exist.

InsertControl

Inserts a control into the Controls array property.

Invalidate

Schedules a control repaint.

LockDrawing

Call LockDrawing method to prevent changes in that control from being redrawn.

PaintTo

Draws the windowed control to a device context.

PreProcessMessage

Returns False, no matter the value of Msg.

Realign

Forces the control to realign children.

RemoveControl

Removes a specified control from the Controls array.

Repaint

Repaints the entire control.

ScaleBy

Rescale control and its children.

ScaleForPPI

Embarcadero Technologies does not currently have any additional information.

ScrollBy

Scroll control contents.

SetBounds

Sets the windowed control's boundary properties all at once.

SetDesignVisible

Makes a control visible at design time.

SetFocus

Gives the input focus to the control.

UnlockDrawing

Call UnlockDrawing method to allow changes in that control to be redrawn.

Update

Forces the control to update.

UpdateControlState

Respond to state change.

Attributes

Action

Specifies the action associated with the control.

Align

Determines how the control aligns within its container (parent control).

AlignDisabled

Indicates child control realignment disabled.

AlignWithMargins

Specifies whether a control should be constrained by margins.

Anchors

Specifies how the control is anchored to its parent.

BiDiMode

Specifies the bidirectional mode for the control.

BoundsRect

Specifies the bounding rectangle of the control, expressed in the coordinate system of the parent control.

Brush

Determines the color and pattern used for painting the background of the control.

ClassName

Returns the TObject.ClassName

ClientHeight

Specifies the height of the control's client area in pixels.

ClientOrigin

Specifies the screen coordinates (in pixels) of the upper-left corner of a control's client area.

ClientRect

Specifies the size of a control's client area in pixels.

ClientWidth

Specifies the horizontal size of the control's client area in pixels.

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Indicates the number of components owned by the component.

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

<Delphi indexed property Components of type TComponent at 21141642500>

Constraints

Specifies the size constraints for the control.

ControlCount

Returns the number of child controls.

ControlState

Specifies the current state of a control at run time.

ControlStyle

Determines style characteristics of the control.

Controls

<Delphi indexed property Controls of type TWinControl at 211416EE760>

CurrentPPI

Embarcadero Technologies does not currently have any additional information.

Cursor

Specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

CustomHint

CustomHint is a custom hint for the control.

DesignInfo

Contains information used by the Form designer.

DockClientCount

Specifies the number of controls that are docked on the windowed control.

DockClients

<Delphi indexed property DockClients of type TWinControl at 211416EE520>

DockManager

Specifies the control's docking manager interface.

DockOrientation

DockOrientation specifies how the control is docked relative to other controls docked in the same parent.

DockSite

Specifies whether the control can be the target of drag-and-dock operations.

DoubleBuffered

Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.

Enabled

Controls whether the control responds to mouse, keyboard, and timer events.

ExplicitHeight

Specifies the explicit vertical size of the control in pixels.

ExplicitLeft

Specifies the explicit horizontal pixel coordinate of the left edge of a component relative to its parent.

ExplicitTop

Specifies the explicit vertical pixel coordinate of the top edge of a component relative to its parent.

ExplicitWidth

Specifies the explicit horizontal size of the control in pixels.

Floating

Specifies whether the control is floating.

FloatingDockSiteClass

Specifies the class of the temporary control that hosts the control when it is floating.

Handle

Provides access to the underlying Windows screen object for the control.

Height

Specifies the vertical size of the control in pixels.

HelpContext

The HelpContext property contains the numeric context ID that identifies the Help topic for the control.

HelpKeyword

The HelpKeyword property contains the keyword string that identifies the Help topic for the control.

HelpType

Specifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.

Hint

Hint contains the text string that appears when the user moves the mouse over the control.

HostDockSite

Specifies the control in which the control is docked.

IsDrawingLocked

IsDrawingLocked property returns True when redrawing for this control is locked.

LRDockWidth

Specifies the width of the control when it is docked horizontally.

Left

Specifies the horizontal coordinate of the left edge of a component relative to its parent.

Margins

Specifies the margins of the control.

MouseInClient

Indicates whether the mouse pointer is currently in the client area of the control.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

OnGesture

<Delphi property OnGesture of type TControl at 211418EC500>

Owner

Indicates the component that is responsible for streaming and freeing this component.

Padding

Specifies the padding of a control.

Parent

Specifies the parent of the control.

ParentCustomHint

Specifies where a control looks for its custom hint.

ParentDoubleBuffered

ParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent's DoubleBuffered property.

ParentWindow

Reference to parent's underlying control.

PixelsPerInch

Embarcadero Technologies does not currently have any additional information.

RedrawDisabled

RedrawDisabled property returns True when redrawing for this control is locked.

ScaleFactor

Embarcadero Technologies does not currently have any additional information.

ShowHint

ShowHint specifies whether to show the Help Hint when the mouse pointer moves over the control.

Showing

Indicates whether the control is showing on the screen.

StyleElements

Specifies the style elements that are used by the control.

StyleName

Embarcadero Technologies does not currently have any additional information.

TBDockHeight

Specifies the height of the control when it is docked vertically.

TabOrder

Indicates the position of the control in its parent's tab order.

TabStop

Determines whether the user can tab to a control.

Tag

Stores a NativeInt integral value as a part of a component.

Top

Specifies the Y coordinate of the upper-left corner of a control, relative to its parent or containing control in pixels.

Touch

Specifies the touch manager component associated with the control.

UndockHeight

Specifies the height of the control when it is floating.

UndockWidth

Specifies the width of the control when it is floating.

UseDockManager

Specifies whether the docking manager is used in drag-and-dock operations.

VCLComObject

Represents information used internally by components that support COM.

Visible

Specifies whether the component appears onscreen.

VisibleDockClientCount

Specifies the number of visible controls that are docked on the windowed control.

Width

Specifies the horizontal size of the control or form in pixels.

WindowProc

<Delphi property WindowProc of type TControl at 211418EC1C0>

AlignDisabled#

Indicates child control realignment disabled. AlignDisabled returns true if child control realignment has been temporarily disabled by a call to DisableAlign.

Broadcast(Message)#

Sends a message to each of the child controls. Use Broadcast when you want to send the same message to each of the child controls contained within the windowed control. Specify the message to be passed as the value of the Message parameter.

Brush#

Determines the color and pattern used for painting the background of the control. The Brush property accesses the TBrush object that determines pattern and color for the control background. Brush is a read-only property, but an application can manipulate the TBrush object by setting its properties or by using its Assign method.

CanFocus()#

Indicates whether a control can receive focus. Call CanFocus to find out if the control can receive input from the user. CanFocus returns true if both the control and its parent(s) have their Visible and Enabled properties set to true. If any of the Visible and Enabled properties of the control or the controls in which it is contained are not true, then CanFocus returns false.

ContainsControl(Control: Control) Boolean#

Indicates whether a specified control exists within the control. Use ContainsControl to find out if a particular control exists within this control. ContainsControl returns true if the specified value of the Control parameter is a child control of this control. The Control parameter need not be an immediate child (in the Controls property), but may be contained in a child of the control, or in a child of a child of the control, for indefinitely many levels deep. If the method returns false, the specified control is not within the control.

ControlAtPos(Pos: Point, AllowDisabled: Boolean, AllowWinControls: Boolean, AllLevels: Boolean) Control#

Returns the child control located at a specified position within the control. Use ControlAtPos to determine which child control is at the specified location within the control. ControlAtPos returns an immediate child of the control; that is, one of the entries of the Controls property, that has this control for its Parent property. Specify the position in client coordinates as the value of the Pos parameter. Pos can be anywhere within the boundaries of the child control, not just the upper left corner. The AllowDisabled parameter determines whether the search for controls includes disabled controls. The AllowWinControls parameter determines whether descendants of TWinControl are considered when looking for the child control. If there is no control that matches the AllowDisabled and AllowWinControls parameters at the specified position, ControlAtPos returns nil (Delphi) or NULL (C++).

ControlCount#

Returns the number of child controls. Read ControlCount when iterating over all the children of this control. The children of the control are listed in the Controls property array. ControlCount is a read-only property.

Note: The value of ControlCount is always 1 greater than the highest Controls index, because the first Controls index is 0.

Controls#

<Delphi indexed property Controls of type TWinControl at 211416EE760>

Create(AOwner: Component)#

Creates an instance of TWinControl. Call Create to construct and initialize a new control and insert the newly-constructed control into its owner, as specified by the AOwner parameter. Create inserts the control in the owner by calling the owner’s InsertComponent method. Most controls override Create to initialize their unique properties. Objects that override the Create method must always call the inherited Create method first, and then proceed with the component-specific initialization. Specify the override directive when overriding the Create method. If a component’s Create method allocates resources or memory, override the Destroy method to free those resources.

CreateParented(ParentWindow: HWND)#

<Delphi method CreateParented of type TWinControl at 211418ED130>

CreateParentedControl(ParentWindow: HWND) WinControl#

Creates and initializes a control as the child of a specified non-VCL window. Call CreateParentedControl to embed a new control in a non-VCL parent. CreateParentedControl allocates memory for a new instance of the same class as the control (Delphi) or is the class specified by the vmt parameter (C++), sets its ParentWindow property to ParentWindow, and calls the constructor, passing in nil (Delphi) or NULL (C++) for the Owner parameter. CreateParentedControl returns the newly created control. CreateParentedControl has the same purpose as CreateParented, but is a simple class function instead of a constructor. Unlike CreateParented, CreateParentedControl can be called from C++ code.

DefaultHandler(Message)#

Provides message handling for all messages that the control does not fully process by itself. Override DefaultHandler to change the default message handling for the control. The Message parameter can be cast to a TMessage type, to obtain the WParam, LParam, and Result of the message. If the Result of the message is non-zero, the message has already been handled. Set the Result field to a non-zero value to prevent further processing of the message by the inherited method.

Note: In Delphi code, calling inherited in a message-handling method results in a call to the ancestor’s DefaultHandler method unless that ancestor specifies an explicit handler for the message. TWinControl overrides the TControl DefaultHandler method to handle messages for all its descendant types. DefaultHandler passes any otherwise-unhandled messages to the control’s window procedure using the CallWindowProc API function.

Destroy()#

Destroys an instance of TWinControl. Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TWinControl reference is not nil, and only then calls Destroy.

DisableAlign()#

Disables the realignment of child controls. Call DisableAlign to temporarily prevent child controls from realigning. For example, while performing multiple manipulations of controls, such as reading from a form file or scaling, performance improves if child controls are not realigned until all manipulations are complete. The EnableAlign method restores normal child realignment. Every call to DisableAlign must be followed by a matching call to EnableAlign. If an exception could be raised after the call to DisableAlign, use an exception block to ensure that EnableAlign will always be called. DisableAlign/EnableAlign call sequences can be nested. An internal counter records the level of nesting. As long as the counter is positive, realignment is disabled and the AlignDisabled property returns true. Once the counter returns to zero, realignment is enabled and AlignDisabled returns false.

DockClientCount#

Specifies the number of controls that are docked on the windowed control. Use DockClientCount to get the number of controls that are docked to the windowed control. This value can be used as an upper bound when iterating through the DockClients property.

Note: The DockClients property can contain controls that are not visible. To get the number of docked clients that are visible, use the VisibleDockClientCount property instead.

DockClients#

<Delphi indexed property DockClients of type TWinControl at 211416EE520>

DockDrop(Source: DragDockObject, X: Integer, Y: Integer)#

Generates an OnDockDrop event. DockDrop is called automatically when a control is docked to the windowed control. It instructs the control that is being dropped to prepare for the dock operation and then generates an OnDockDrop event. Although you can override DockDrop to perform actions in addition to the generated OnDockDrop event, typically descendant classes override the DoAddDockClient method instead. This is because DoAddDockClient is called by the client after it has performed its own preparations, but before the OnDockDrop event. DockDrop is called only if DockSite is True.

DockManager#

Specifies the control’s docking manager interface. Use DockManager to specify the control’s docking manager. The docking manager handles the layout of docking zones (where controls are docked) and any painting associated with docking zones. If you set DockSite and UseDockManager to true, but do not assign a value to DockManager, the windowed control generates a default docking manager, using the global DefaultDockTreeClass variable.

DockSite#

Specifies whether the control can be the target of drag-and-dock operations. Set DockSite to true to allow other controls to be docked to this windowed control.

Code Examples Docking (Delphi) Docking (C++)

DoubleBuffered#

Determines whether the control’s image is rendered directly to the window or painted to an in-memory bitmap first. When DoubleBuffered is false, the windowed control paints itself directly to the window. When DoubleBuffered is true, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive. When a windowed control is a dock site and has an associated dock manager, it must be double-buffered.

Note: Some controls, such as TRichEdit, can’t paint themselves into a bitmap. For such controls, DoubleBuffered must be set to false.

EnableAlign()#

Decrements the reference count incremented by the DisableAlign method, eventually realigning the child controls. Call EnableAlign to allow child controls within the control to realign again after they were prevented from realigning by a call to DisableAlign. Each time the DisableAlign method is called, it increments a reference count. Each time EnableAlign is called, it decrements the same reference count. When the reference count reaches zero, EnableAlign calls the Realign method to perform any pending realignments. Be sure to pair each call to DisableAlign with a call to EnableAlign. If an exception could be raised after the call to DisableAlign, use an exception block to ensure that the corresponding call to EnableAlign is executed.

FindChildControl(ControlName: string) Control#

Returns a child control given its name. Call FindChildControl to locate a specified child control. FindChildControl searches the control’s children and returns the control with the specified name. If no child controls match the specified name, FindChildControl returns nil (Delphi) or NULL (C++).

Note: FindChildControl only locates immediate children of the control. It can’t find a control that is a child of one of the control’s children.

FlipChildren(AllLevels: Boolean)#

Reverses the positions of child controls. Call FlipChildren to flip the control’s children; that is, to move children on the left side of the control to the right side and vice versa. FlipChildren reverses the position of all child controls and adjusts their Align properties, if necessary, to enforce the new position. AllLevels specifies whether FlipChildren should be called recursively on the control’s children. FlipChildren can be used to reverse the layout of an application when it is running in Middle Eastern locales where users read from right to left instead of left to right: Call UseRightToLeftAlignment to determine whether the BiDiMode property dictates a reversal of alignment based on the system locale.

Note: FlipChildren does the same thing as the Flip Children command on the control’s context menu in the IDE.

Focused()#

Determines whether the control has input focus. Use the Focused method to see if the control is the active control. When Focused returns true, the control has the input focus. If Focused returns false, the user cannot interact with the control.

GetChildren(Proc: GetChildProc, Root: Component)#

Calls a specified method for each child of the control. GetChildren is called by the streaming system that loads and saves components. Applications seldom need to call this routine. GetChildren executes the callback specified by the Proc parameter for every child control listed by the Controls property that lists the Root parameter as its Owner. Override GetChildren to limit or augment which child controls are saved with the control. When overriding GetChildren, call the procedure passed as the Proc parameter for every child control that should be saved. The Root parameter indicates the component (usually a form) that owns the control.

GetTabControlList(List: List)#

Builds a list of owned controls. Call GetTabControlList to construct a list of child controls. GetTabControlList iterates through the control’s internal tab order list, adding each of the child controls to List. The result is a list of all the owned controls in TabOrder.

GetTabOrderList(List: List)#

Builds a list of controls in tab order. Call GetTabOrderList to construct a list of child controls in tab order. GetTabOrderList iterates through the control’s internal tab order list, adding each of the child controls to List, including any controls contained in those controls. The result is a list of all the controls and their owned controls, in tab order. The FindNextControl method calls GetTabOrderList to build a complete list of the controls that FindNextControl uses to locate the next control in the tab order.

Handle#

Provides access to the underlying Windows screen object for the control. The Handle property returns the window handle for the underlying Microsoft Windows screen object. Use the Handle property to bypass the VCL API and directly access the underlying window. Do not refer to the Handle property during component creation or streaming. The underlying window does not exist until the first time the Handle property is referenced. When this occurs, the HandleNeeded method is called automatically. Handle is a read-only property.

Note: On Win64, the size of HANDLE types has changed to 64-bits –except for OLE_HANDLE, which is now a 32bit Long even in Win64. This means that you need to change any code that assumed OLE_HANDLE and other HANDLE types are interchangeable. See also http://stackoverflow.com/questions/401812/what-is-the-proper-way-to-cast-from-an-ole-handle-to-an-hicon.

HandleAllocated()#

Reports whether a screen object handle exists for the control. Query HandleAllocated to find out if the control’s underlying screen object has been generated. If the screen object exists, HandleAllocated returns true. If the screen object does not exist, HandleAllocated returns false. Testing the Handle property of a control directly causes the window to be created if it does not already exist. Call the HandleAllocated method to determine whether a window exists without creating one as a side effect.

HandleNeeded()#

Creates a screen object for the control if it doesn’t already exist. Call HandleNeeded to create a screen object for the control. If the screen object does not exist, HandleNeeded calls the CreateHandle method for the parent of the control before it creates a screen object for this control.

InsertControl(AControl: Control)#

Inserts a control into the Controls array property. Applications should not need to call InsertControl directly. Child controls are automatically inserted and removed when added or deleted at design time. At run time, use the Parent property of the child control to insert it in the Controls array. If the child control is already the child of another control, setting the Parent property ensures that the child is removed from the Controls of the original parent. InsertControl makes the inserted control a child, and the containing control the parent. The AControl parameter is the child control that is inserted into the Controls array.

Invalidate()#

Schedules a control repaint. Invalidate informs a control that its entire surface needs to be repainted. Calling Invalidate can prevent flicker caused by a series of partial repaints. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted. The actual repaint does not occur until the control is updated. To force an immediate repaint, call Repaint instead.

IsDrawingLocked#

IsDrawingLocked property returns True when redrawing for this control is locked. It is True when the number of LockDrawing calls is less than UnlockDrawing calls for this control.

LockDrawing()#

Call LockDrawing method to prevent changes in that control from being redrawn. To resume redrawing call UnlockDrawing method. If to recreate a window handle after a LockDrawing call, the control will remain locked until the corresponding UnlockDrawing call. LockDrawing / UnlockDrawing calls may be nested.

MouseInClient#

Indicates whether the mouse pointer is currently in the client area of the control. Use MouseInClient to check whether the mouse pointer is currently located in the client area of the control. MouseInClient is also used internally to fire the OnMouseEnter and OnMouseLeave events.

Padding#

Specifies the padding of a control. Use Padding to specify the padding of a control. This value is an instance of the class TPadding.

PaintTo(DC: HDC, X: Integer, Y: Integer)#

Draws the windowed control to a device context. Call PaintTo to draw the control on a device context. Specify the device context as the value of the DC parameter and specify the X and Y coordinates on the device context where the top-left corner of the windowed control is to be drawn. PaintTo first erases the background of the device context and then paints the control. PaintTo is useful for drawing an image of the control into a bitmap DC.

Warning: When using PaintTo to draw on a canvas, you must lock the canvas first (and unlock it after the call to PaintTo. If you do not lock the canvas, Windows calls that occur while the control is painting can cause the canvas to lose its handle. Draws the windowed control to a device context. Call PaintTo to draw the control on a device context. Specify the device context as the value of the DC parameter and specify the X and Y coordinates on the device context where the top-left corner of the windowed control is to be drawn. PaintTo first erases the background of the device context and then paints the control. PaintTo is useful for drawing an image of the control into a bitmap DC.

Warning: When using PaintTo to draw on a canvas, you must lock the canvas first (and unlock it after the call to PaintTo. If you do not lock the canvas, Windows calls that occur while the control is painting can cause the canvas to lose its handle.

ParentDoubleBuffered#

ParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent’s DoubleBuffered property. ParentDoubleBuffered is a boolean indicating that the DoubleBuffered property of this component is overridden by the value of the parent’s DoubleBuffered property.

ParentWindow#

Reference to parent’s underlying control. ParentWindow refers to the window handle that underlies the parent control. To designate a non-VCL control as a parent, assign that control’s handle to ParentWindow. This assignment causes the control to be moved into the parent’s screen area. Setting ParentWindow has no effect if Parent is not nil (Delphi) or NULL (C++). TActiveXControl objects use ParentWindow to insert a control in an ActiveX container window. ParentWindow is set automatically when a control is constructed with a call to CreateParented (Delphi) or the appropriate overloaded constructor (C++). Use ParentWindow with windowed controls that are packaged in a DLL. This allows references to the control by applications based on other applications.

PixelsPerInch#

Embarcadero Technologies does not currently have any additional information.

PreProcessMessage(Msg: tagMSG) Boolean#

Returns False, no matter the value of Msg. As a member of the TWinControl class, PreProcessMessage always returns False, no matter the value of Msg.

Note: When overriding PreProcessMessage in descendant classes, we recommend to implement it such that it returns True if Msg is a preprocess message, and False otherwise.

Realign()#

Forces the control to realign children. The EnableAlign method calls Realign when the reference count reaches zero. It adjusts the size and position of any child controls according to their Align properties. If all of the child controls have their Align properties set to alNone, Realign has no effect.

RedrawDisabled#

RedrawDisabled property returns True when redrawing for this control is locked. It is similar to IsDrawingLocked, but uses Win32 API to determine when a Win32 window redrawing is disabled. For example, when a parent control redrawing is locked using LockDrawing, then IsDrawingLocked returns True for parent control and False for child control. RedrawDisabled returns True for both parent and child controls.

RemoveControl(AControl: Control)#

Removes a specified control from the Controls array. RemoveControl removes a child control from the Controls property. After calling RemoveControl, the control is no longer the parent of the child specified by the AControl parameter. Applications should not call RemoveControl directly. Child controls are automatically inserted and removed when added or deleted at design time. At runtime, use the Parent property of the child control to remove it from the Controls array.

Repaint()#

Repaints the entire control. Call Repaint to repaint the control. As implemented in TWinControl, Repaint calls the Invalidate method and then the Update method to repaint the control.

ScaleBy(M: Integer, D: Integer)#

Rescale control and its children. ScaleBy resizes a control without moving its upper left corner. This is similar to changing the Height and Width properties, but the control also attempts to rescale and rearrange any child controls to maintain their relative size and placement. The M and D parameters define a multiplier and divisor by which to scale the control. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100. Any pair of values that has the same ratio has the same effect. Thus M = 3 and D = 4 also makes the control 75% of its previous size. To rescale the control’s children without rescaling the control itself, use ScaleControls.

ScaleForPPI(NewPPI: Integer)#

Embarcadero Technologies does not currently have any additional information.

ScrollBy(DeltaX: Integer, DeltaY: Integer)#

Scroll control contents. Call ScrollBy to scroll the contents within the control. While ScrollBy can be used for any TWinControl, it makes the most sense to use it for descendants of TScrollingWinControl. Applications seldom need to call the ScrollBy method unless they implement their own scrolling interface rather than relying on a scroll bar. The DeltaX parameter is the change in pixels along the X axis. A positive DeltaX value scrolls the contents to the right; a negative value scrolls the contents to the left. The DeltaY parameter is the change in pixels along the Y axis. A positive DeltaY value scrolls the contents down; a negative value scrolls the contents up.

SetBounds(ALeft: Integer, ATop: Integer, AWidth: Integer, AHeight: Integer)#

Sets the windowed control’s boundary properties all at once. Use SetBounds to change all of the control’s boundary properties at once. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately. By setting all four properties at once, SetBounds ensures that the control will not repaint between changes Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.

SetDesignVisible(Value: Boolean)#

Makes a control visible at design time. Vcl.Controls.TWinControl.SetDesignVisible inherits from Vcl.Controls.TControl.SetDesignVisible. All content below this line refers to Vcl.Controls.TControl.SetDesignVisible. Makes a control visible at design time. SetDesignVisible is used internally by Delphi during form design.

SetFocus()#

Gives the input focus to the control. Use SetFocus to change input focus to the control. When a control has focus, it receives keyboard events.

Showing#

Indicates whether the control is showing on the screen. Showing is used internally to optimize the allocation of Windows resources. Use Showing to determine when you must allocate resources that are required when the control is visible. When Showing is false, the control is not visible and you can delay the allocation of resources. If the Visible properties of a component and all the parents in its parent hierarchy are true, Showing is guaranteed to be true. If one of the parents containing the control has a Visible property value of false, Showing may be either true or false. Showing is a read-only property.

TabOrder#

Indicates the position of the control in its parent’s tab order. TabOrder is the order in which child windows are visited when the user presses the Tab key. The control with the TabOrder value of 0 is the control that has the focus when the form first appears. Initially, the tab order is always the order in which the controls were added to the form. The first control added to the form has a TabOrder value of 0, the second is 1, the third is 2, and so on. Change this by changing the TabOrder property. Each control has a unique tab-order value within its parent. If you change the TabOrder property value of one control to be the same as the value of a second control, the TabOrder value for all the other controls changes. For example, suppose a control is sixth in the tab order. If you change the control’s TabOrder property value to 3 (making the control fourth in the tab order), the control that was originally fourth in the tab order now becomes fifth, and the control that was fifth becomes sixth. Assigning TabOrder a value greater than the number of controls contained in the parent control moves the control to the end of the tab order. The control does not take on the assigned value of TabOrder, but instead is given the number that assures the control is the last in the tab order.

Note: TabOrder is meaningful only if the TabStop property is True and if the control has a parent. (The TabOrder property of a form is not used unless the form is the child of another form.) A control with a TabOrder of -1 has no parent, and therefore cannot be reached by pressing the Tab key. To remove a parented control from the Tab order, set its TabStop property to False.

TabStop#

Determines whether the user can tab to a control. Use the TabStop to allow or disallow access to the control using the Tab key. If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user cannot press the TAB key to move to the control.

Note: TabStop is not meaningful for a form unless the form assigns another form to be its parent.

UnlockDrawing()#

Call UnlockDrawing method to allow changes in that control to be redrawn. LockDrawing / UnlockDrawing calls may be nested.

Update()#

Forces the control to update. Update repaints any part of the control surface that is out of date. Normally, updates occur automatically, but an Update call may be necessary before lengthy processing that might interfere with automatic updates. Calling Update unnecessarily can increase overhead and cause screen flicker. Update only repaints areas of the control the have been determined to be out of date. To force immediate repainting of the entire control, call the Repaint method. To notify a control that it is out of date (without forcing an immediate repaint), call the Invalidate method.

UpdateControlState()#

Respond to state change. UpdateControlState is called automatically when any display change occurs that might affect the internal state of the control. As implemented in TWinControl, UpdateControlState climbs the chain of parent controls to verify that each control in the chain has Showing equal to true. If this is the case, UpdateControlState makes sure that the Showing property is accurate for this control and for all its descendants. Descendant classes can extend this behavior.

UseDockManager#

Specifies whether the docking manager is used in drag-and-dock operations. Use UseDockManager to get or set whether a docking manager is used in drag-and-dock operations. The docking manager handles the positioning of docked controls and any painting of docking zones around those controls. If you do not use a docking manager, docked controls are aligned to the windowed control based on the closest edge to where they are released. When you do not use a docking manager, there is no region for a user to grab to automatically undock a docked control.

VisibleDockClientCount#

Specifies the number of visible controls that are docked on the windowed control. Use VisibleDockClientCount to determine the number of controls in the DockClients list that have a Visible property value of true. This value is less than or equal to the value of DockClientCount.