Namespace: Consultingwerk.Util
Class 
ControlHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:ControlHelper
Purpose:Class contains generic supporting routines to work
with .NET Controls
Syntax:Static methods only, private constructor to disallow
instance creation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Mon Jul 12 20:31:09 CEST 2010
Notes:This file is intended for GUI for .NET only
The result temp-table description is in Consultingwerk/Util/TempTables/ttClassNames.i
Purpose: Constructor for the ControlHelper class
Notes: Protected default constructor



Top Method Summary
Options Name Purpose
+ System.Windows.Forms.Control AssignValue (Control, Object) Assigns a value to a field level control
+ LOGICAL ExistsByName (character, IEnumerable) Returns if the given list contains an object with the given name
+ LOGICAL ExistsByName (IEnumerable, character) Returns if the given list contains an object with the given name
+ LOGICAL ExistsByTag (character, IEnumerable) Returns if the given list contains an object with the given Tag
+ LOGICAL ExistsByTag (IEnumerable, character) Returns if the given list contains an object with the given Tag
+ System.Collections.Generic.List <System.Windows.Forms.Control> FindAllControlsOfType (Control, Type) Returns a List of all Controls in the Form that are of the given type
# FindAllControlsOfType (Control, Control>, Type) Returns a List of all Controls in the Form that are of the given type
+ System.Object FindByTag (character, IEnumerable) Returns the first object from the list with the given Tag
+ System.Object FindByTag (IEnumerable, character) Returns the first object from the list with the given Tag
+ System.Object FindByTag (Object, Control+ControlCollection) Returns the first object from the list with the given Tag
+ System.Windows.Forms.Control FindLastControl (Control) Locates the Control in the given parent control that is the last Control by TabIndex
+ System.Windows.Forms.Control FindParentControlOfType (Control, Type) Walks up the Parent-Chain of a .NET Control and returns the first ParentControl that is compatible with the given type
+ System.Windows.Forms.UserControl FindParentUserControl (Control) Walks up the Parent-Chain of a .NET Control and returns the first UserControl
+ LOGICAL FocusFirstControl (Control) Focusses the first enabled control in the given parent control
+ System.Windows.Forms.Control GetControlByChildIndex (Control+ControlCollection, integer) Returns the Control with the given ChildIndex in the ControlsCollection
+ System.Windows.Forms.AnchorStyles SetControlAnchor (Control, character) Sets the Anchor property of the control based on a comma-delimited list

Top Constructor Summary
Options Name Purpose
# ControlHelper () Constructor for the ControlHelper class


Method Detail
Top

PUBLIC System.Windows.Forms.Control AssignValue (Control, Object)

Purpose: Assigns a value to a field level control
Notes: Assigns to Value for known Infragistics Controls and
Text to all other controls

Parameters:
poControl System.Windows.Forms.Control
The reference to the .NET Control
poValue System.Object
The Value to assign to the Control
Returns System.Windows.Forms.Control
The reference to the Control
Top

PUBLIC LOGICAL ExistsByName (character, IEnumerable)

Purpose: Returns if the given list contains an object with the given name
Notes: Some Telerik lists do not provide an Exists method. This method here
may be used to test if a list contains an object with the provided
Name

Parameters:
pcName CHARACTER
The name to test for
poCollection System.Collections.IEnumerable
The list to test in
Returns LOGICAL
Logical property indicating if the list contains an object with the given name
Top

PUBLIC LOGICAL ExistsByName (IEnumerable, character)

Purpose: Returns if the given list contains an object with the given name
Notes: Some Telerik lists do not provide an Exists method. This method here
may be used to test if a list contains an object with the provided
Name

Parameters:
poCollection System.Collections.IEnumerable
The list to test in
pcName CHARACTER
The name to test for
Returns LOGICAL
Logical property indicating if the list contains an object with the given name
Top

PUBLIC LOGICAL ExistsByTag (character, IEnumerable)

Purpose: Returns if the given list contains an object with the given Tag
Notes: Some Telerik lists do not provide an Exists method. This method here
may be used to test if a list contains an object with the provided
Name

Parameters:
pcTag CHARACTER
The Tag value to test for
poCollection System.Collections.IEnumerable
The list to test in
Returns LOGICAL
Logical property indicating if the list contains an object with the given Tag
Top

PUBLIC LOGICAL ExistsByTag (IEnumerable, character)

Purpose: Returns if the given list contains an object with the given Tag
Notes: Some Telerik lists do not provide an Exists method. This method here
may be used to test if a list contains an object with the provided
Name

Parameters:
poCollection System.Collections.IEnumerable
The list to test in
pcTag CHARACTER
The Tag value to test for
Returns LOGICAL
Logical property indicating if the list contains an object with the given Tag
Top

PUBLIC System.Collections.Generic.List <System.Windows.Forms.Control> FindAllControlsOfType (Control, Type)

Purpose: Returns a List of all Controls in the Form that are of the given type
Notes:

Parameters:
poContainerControl System.Windows.Forms.Control
The reference to the parent control
poType System.Type
The reference to the System.Type
Returns System.Collections.Generic.List <System.Windows.Forms.Control>
The List of all Controls of the given type
Top

PROTECTED FindAllControlsOfType (Control, Control>, Type)

Purpose: Returns a List of all Controls in the Form that are of the given type
Notes:

Parameters:
poParentControl System.Windows.Forms.Control
The current parent Control reference
poList System.Collections.Generic.List
The List of Control to add the matching Controls to
poType System.Type
The reference to the System.Type
Top

PUBLIC System.Object FindByTag (character, IEnumerable)

Purpose: Returns the first object from the list with the given Tag
Notes: Returns ? when the Tag cannot be found

Parameters:
pcTag CHARACTER
The Tag value to search for
poCollection System.Collections.IEnumerable
The list to search in
Returns System.Object
The reference to the object with the given Tag
Top

PUBLIC System.Object FindByTag (IEnumerable, character)

Purpose: Returns the first object from the list with the given Tag
Notes: Returns ? when the Tag cannot be found

Parameters:
poCollection System.Collections.IEnumerable
The list to search in
pcTag CHARACTER
The Tag value to search for
Returns System.Object
The reference to the object with the given Tag
Top

PUBLIC System.Object FindByTag (Object, Control+ControlCollection)

Purpose: Returns the first object from the list with the given Tag
Notes: Returns ? when the Tag cannot be found

Parameters:
poTag System.Object
The Tag value as a System.Object reference
poCollection System.Windows.Forms.Control+ControlCollection
The control collection to search in
Returns System.Object
The reference to the object with the given Tag
Top

PUBLIC System.Windows.Forms.Control FindLastControl (Control)

Purpose: Locates the Control in the given parent control that is the
last Control by TabIndex
Notes:

Parameters:
poParentControl System.Windows.Forms.Control
The parent control
Returns System.Windows.Forms.Control
The last child control
Top

PUBLIC System.Windows.Forms.Control FindParentControlOfType (Control, Type)

Purpose: Walks up the Parent-Chain of a .NET Control and returns the first
ParentControl that is compatible with the given type
Notes: When no user control is found this method returns ?
When used on a Control of the given type, the method will still be
seeking for a compatible Control in the Parent-Chain.

Parameters:
poControl System.Windows.Forms.Control
The Control to search the next parent Control of matching type for
poType System.Type
The System.Type of the Control to search
Returns System.Windows.Forms.Control
The reference to the parent Control
Top

PUBLIC System.Windows.Forms.UserControl FindParentUserControl (Control)

Purpose: Walks up the Parent-Chain of a .NET Control and returns the first
UserControl
Notes: When no user control is found this method returns ?
When used on a UserControl, the method will still be seeking for a
UserControl in the Parent-Chain.

Parameters:
poControl System.Windows.Forms.Control
The Control to search the next parent UserControl for
Returns System.Windows.Forms.UserControl
The reference to the parent UserControl
Top

PUBLIC LOGICAL FocusFirstControl (Control)

Purpose: Focusses the first enabled control in the given parent control
Notes: Ignores Label, UltraLabel and RadLabel controls

Parameters:
poParentControl System.Windows.Forms.Control
The parent control
Returns LOGICAL
Logical value indicating if a control was focussed
Top

PUBLIC System.Windows.Forms.Control GetControlByChildIndex (Control+ControlCollection, integer)

Purpose: Returns the Control with the given ChildIndex in the ControlsCollection
Notes:

Parameters:
poControlCollection System.Windows.Forms.Control+ControlCollection
The ControlsCollection to locate the ChildIndex in
piIndex INTEGER
The Child Index to locate the Control at
Returns System.Windows.Forms.Control
The located Control or ? when no Control was found
Top

PUBLIC System.Windows.Forms.AnchorStyles SetControlAnchor (Control, character)

Purpose: Sets the Anchor property of the control based on a comma-delimited list
Notes:

Parameters:
poControl System.Windows.Forms.Control
The reference to the control
pcAnchor CHARACTER
The comma-delimited list of Anchor styles
Returns System.Windows.Forms.AnchorStyles
The resulting AnchorStyles


Constructor Detail
Top

PROTECTED ControlHelper ()

Purpose: Constructor for the ControlHelper class
Notes: Protected default constructor



©2006-2023 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       15.04.2024 06:16:32