# Button Click Command - HMI

The Click Command property can be associated with the following HMI interactions:

Note: These interactions can also be called via a script. For more information, see the $ Functions: WebPages HMI.

Click Command | Description | Arguments (with Data Type)
--- | --- | ---
HMI.CloseDialogPage | Closes the active dialog page. | N/A
HMI.GetControlProperty | Fetches the specified property of the specified control element. Note: Cognex recommends using the published property, when available, instead of using this command. | controlname: String, specifying the name of the control element. propertyname: String, specifying the name of the property.
HMI.GetPageBackgroundColor | Fetches the background color the webpage specified with the "pageName" argument. | "pageName": The name of the webpage, specified as a string.
HMI.GetPageBorderColor | Fetches the border color of the webpage specified with the "pageName" argument. | "pageName": The name of the webpage, specified as a string.
HMI.GetPageHeight | Fetches the height of the webpage specified with the "pageName" argument. | "pageName": The name of the webpage, specified as a string.
HMI.GetPageTitle | Fetches the title of the webpage specified with the "pageName" argument. | "pageName": The name of the webpage, specified as a string.
HMI.GetPageWidth | Fetches the width of the webpage specified with the "pageName" argument. | "pageName": The name of the webpage, specified as a string.
HMI.Login | Logs in to the HMI webpage with the specified username and password. | username: String, specifying the name of the user used for login. password: String, specifying the password of the user used for login.
HMI.Logout | Logs out of the HMI webpage. | N/A
HMI.SetControlProperty | Sets the property (specified with the propertyName argument) of the control element (specified with the controlName argument) to a new value (provided with the newValue argument). Note: Cognex recommends using the published property, when available, instead of using this command. | controlName: String, specifying the name of the control element. propertyName: String, specifying the name of the property to set. newValue: Integer, double, boolean or string, specifying the new value of the property to set.
HMI.SetFocusOn | Sets the focus on the control element specified with the controlName argument. | controlName: String, specifying the name of the control element to focus.
HMI.ShowError | Shows the error specified with the message and title arguments. | message: String, specifying the text of the error to show. title: String, specifying the title of the error to show.
HMI.ShowInformation | Shows the information message specified with the message and title arguments. | message: String, specifying the text of the message to show. title: String, specifying the title of the message to show.
HMI.ShowLogin | Shows the login process. | N/A
HMI.ShowMessage | Shows the message specified with the message argument. | message: String, specifying the message to show.
HMI.ShowPage | Shows the page specified with the pageName argument. | pageName: String, specifying the name of the web page to show.
HMI.ShowQuestion | Shows the question specified with the message and title arguments. | message: String, specifying the text of the question to show. title: String, specifying the title of the question to show.