Message Box Functions Reference (iLogic)

Use Message Box functions to create message boxes and data input boxes in a rule.

MessageBox.Show and InputBox are standard VB.NET functions. Consult your VB.NET documentation for more information.

MessageBox.Show is a VB.NET version of the MsgBox function from VB6 and VBA. You can still use MsgBox in iLogic rules.

InputListBox and InputRadioBox are iLogic functions.

To access the Message Box functions, expand the MessageBox node under the System tab in the Snippets area of the iLogic Edit Rule dialog.

You can use the Message Box wizard from the Add Rule dialog box to help you write code for a message box.

MessageBox.Show function in iLogic

Acts as the base for the Message Box functions in iLogic. Use this function to show a message box.

Syntax

MessageBox.Show("Message", "Title")

“Message”

The contents of the text area of the message box.

“Title”

The contents of the title bar of the message box.

MessageBoxButtons function in iLogic

You can specify the buttons included in a message box by using the MessageBoxButtons parameter to specify the appropriate values in the MessageBox.Show function.

For example:

MessageBox.Show("Message",'"Title", MessageBoxButtons.OK)

This option produces a simple message box with the OK button:

Other options include:

MessageBox.Show("Message",'"Title", MessageBoxButtons.OKCancel)
MessageBox.Show("Message",'"Title", MessageBoxButtons.RetryCancel)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNo)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel)
MessageBox.Show("Message",'"Title", MessageBoxButtons.AbortRetryIgnore)

MessageBoxIcon function in iLogic

You can add an icon to a message box by including the MessageBoxIcon parameter in the MessageBox.Show function.

For example:

MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Error)

This option adds an error icon to the message box:

Other options include:

MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.None)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)

DefaultButton function in iLogic

You can specify the message box button to select when the message box is first displayed. To specify the button, include the MessageBoxDefaultButton parameter in the MessageBox.Show function. Choose from among the three potential buttons on the message box, depending on the MessageBoxButtons value used.

For example:

MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2)

This option specifies that the second button (No) is selected by default:

Other options include:

MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
MessageBox.Show("Message",'"Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button3)

InputBox function in iLogic

Creates a message box that prompts for and accepts input.

Syntax

myparam = InputBox("Prompt", "Title", "Default Entry")

"Prompt"

Message to appear in the box.

"Title"

Text to appear in the title bar of the box.

"Default Entry"

Text to display in the input field of the box.

Example

InputListBox function in iLogic

Displays a message box with a list of available values. When a value is selected from the list, the function returns that value.

Syntax

d0 = InputListBox("Prompt",MultiValue.List("listName"), defaultEntry, Title := "Dialog Title", ListPrompt := "List Prompt")

"Prompt"

Message to appear above the OK button in the box.

MultiValue.List("listName")

Name of the multi-value list to use.

defaultEntry

Value selected initially in the list box.

Title

Text to appear in the title bar.

ListPrompt

Message

Text to appear above the list in the box.

Returns

d0

Value from the list that was selected.

Example

material = InputListBox("Choose Part material", MultiValue.List("material"),  _
material, Title := "Part material", ListName := "Available Standard materials")

InputRadioBox function in iLogic

Displays a message box that prompts for one of two available options.

Syntax

booleanResult= InputRadioBox("Prompt", "Button1 Label", "Button2 Label", booleanParam, Title :="Title")

"Prompt"

Message to appear in the box.

"Button1 Label"

Message to appear for the first option.

"Button2 Label"

Message to appear for the second option.

booleanParam

Specify True to select the first option, or False to select the second option.

Title

The text to appear in the title bar of the box.

Returns

booleanResult

True if the first option is selected, False if the second option is selected.

Example

booleanParam= InputRadioBox("Choose an Edge Treatment option", "Chamfer", "Fillet", true, Title :="Edge
Treatment")