Modifying multiple forms dynamically

In the AOT, open SysSetupFormRun class, and create a new method with the
following code:

private void addAboutButton()
{
FormActionPaneControl actionPane;
FormActionPaneTabControl actionPaneTab;
FormCommandButtonControl cmdAbout;
FormButtonGroupControl btngrp;
#define.taskAbout(259)
actionPane = this.design().controlNum(1);
if (!actionPane ||
!(actionPane is FormActionPaneControl) ||
actionPane.style() == ActionPaneStyle::Strip)
{
return;
}
actionPaneTab = actionPane.controlNum(1);
if (!actionPaneTab ||
!(actionPaneTab is FormActionPaneTabControl))
{
return;
}
btngrp = actionPaneTab.addControl(
FormControlType::ButtonGroup, 'ButtonGroup');
btngrp.caption("About");
cmdAbout = btngrp.addControl(
FormControlType::CommandButton, 'About');
cmdAbout.command(#taskAbout);
cmdAbout.imageLocation(SysImageLocation::EmbeddedResource);
cmdAbout.normalImage('412');
cmdAbout.big(NoYes::Yes);
cmdAbout.saveRecord(NoYes::No);
}

<strong>In the same class, override the run() method with the following code:</strong>
public void run()
{
this.addAboutButton();
super();
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s