Method SetButtonConfig
SetButtonConfig(ButtonBar, Boolean)
Adopts the button configurations given in buttonBar.
Declaration
Error SetButtonConfig(ButtonBar buttonBar, bool persist = false)
Parameters
Type | Name | Description |
---|---|---|
ButtonBar | buttonBar | A button bar holding the button configurations to be adopted. |
System.Boolean | persist | Persists the configuration to permanent memory on the device. This can only be used a certain number of times. |
Returns
Type | Description |
---|---|
Error | Error |
Examples
This example shows how to get the current button configuration of the button bar for the signature mode and how to modify the configuration of the Ok button.
C#
// Get the current buttonBar for signature mode with the current configuration
driver.GetButtonConfig(out ButtonBar buttonBar, ButtonBarMode.Signature)
// Modify the configuration in the dictionary buttonBar.Configs
if (buttonBar.Configs.Contains(ButtonKind.Ok))
{
ButtonConfig buttonConfig = buttonBar.Configs[ButtonKind.Ok];
buttonConfig.Enabled = true;
buttonConfig.Visible = true;
buttonConfig.FromArgb(0xff, 0xff, 0x00, 0x00); //red
}
// Adopt the changed button configuration.
driver.SetButtonConfig(buttonBar);
VB.NET
Dim buttonBar As ButtonBar
driver.GetButtonConfig(buttonBar, ButtonBarMode.Signature)
If(buttonBar.Configs.ContainsKey(ButtonKind.Ok)) Then
Dim buttonConfig = buttonBar.Configs(ButtonKind.Ok)
buttonConfig.Enabled = True
buttonConfig.Visible = True
buttonConfig.FromArgb(&HFF, &HFF, &H0, &H0)
End If
driver.SetButtonConfig(buttonBar)