Table of Contents

Method SetButtonText

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

SetButtonText(KnownButton, string?)

Sets the text of a specified button.

public virtual bool SetButtonText(KnownButton button, string? text)

Parameters

button KnownButton

The button whose text is to be set.

text string

The new text to display on the button.

Returns

bool

true if the button text was successfully set; otherwise, false.

Remarks

This method attempts to set the text of the specified button, identified by the button parameter. If the button is not found in the panel, the method returns false and no changes are made. If the text parameter is null or empty, the button's text is set to the default text associated with the KnownButton value, as provided by KnownButtons.GetText. Otherwise, the button's text is set to the specified text value.