Class GuiComponent
Base class for all SAP GUI scripting objects. Wraps the raw COM object and provides safe property access via late binding.
public class GuiComponent
- Inheritance
-
GuiComponent
- Derived
- Inherited Members
Properties
Changeable
Whether this component accepts user input.
public bool Changeable { get; }
Property Value
ComponentType
Parsed enum version of TypeName.
public SapComponentType ComponentType { get; }
Property Value
Id
e.g. "wnd[0]/usr/txtRSYST-BNAME"
public string Id { get; }
Property Value
IsModified
Whether the component value has been changed since the last server round-trip.
public bool IsModified { get; }
Property Value
Name
Accessibility name.
public string Name { get; }
Property Value
RawObject
The raw underlying COM object. Use only if you need access to a property not yet exposed by this wrapper.
public object RawObject { get; }
Property Value
Text
Gets or sets the Text property of this component.
Works on text fields, buttons, labels, combo boxes, status bars, etc.
Equivalent to VBA: session.findById("...").Text = "value"
public virtual string Text { get; set; }
Property Value
Tooltip
Screen tooltip / short description.
public string Tooltip { get; }
Property Value
TypeName
e.g. "GuiTextField"
public string TypeName { get; }
Property Value
Methods
GetBool(string)
Reads a boolean property from the underlying COM object via late binding.
protected bool GetBool(string property)
Parameters
propertystringCOM property name, e.g.
"Changeable".
Returns
GetChildAtRaw(int)
Returns a child by its integer index from the component's Children collection.
protected object? GetChildAtRaw(int index)
Parameters
indexint
Returns
GetChildrenRaw()
Returns the raw COM child collection object (GuiComponentCollection). Use FindById(string) for most navigation scenarios.
protected object? GetChildrenRaw()
Returns
GetInt(string)
Reads an integer property from the underlying COM object via late binding.
protected int GetInt(string property)
Parameters
propertystringCOM property name, e.g.
"RowCount".
Returns
GetString(string)
Reads a string property from the underlying COM object via late binding.
protected string GetString(string property)
Parameters
propertystringCOM property name, e.g.
"Text".
Returns
Invoke(string, params object[])
Invokes a method on the underlying COM object via late binding.
protected object? Invoke(string method, params object[] args)
Parameters
Returns
Press()
Clicks / activates this component (calls the COM Press method).
Works on buttons and toolbar entries.
Equivalent to VBA: session.findById("...").Press()
public virtual void Press()
RebindRaw(object)
Replaces the underlying COM object held by this wrapper. Used by components that need to re-fetch their COM reference after SAP re-renders the screen (e.g. GuiTable after a scroll).
protected void RebindRaw(object newRaw)
Parameters
newRawobject
Refresh()
Re-fetches the underlying COM object from SAP and rebinds this wrapper to it.
Useful after SAP re-renders the screen (e.g. after scrolling a GuiTable).
Only works when this instance was obtained via a typed session accessor
(e.g. session.Table(id)) that stores the component ID.
public void Refresh()
SetFocus()
Moves keyboard focus to this component.
public virtual void SetFocus()
SetProperty(string, object)
Sets a property on the underlying COM object via late binding.
protected void SetProperty(string property, object value)
Parameters
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.