CloseButton Property

Property that allows you to get or set whether the dialog box has a close button (the "X" in the top-right corner of the window).

object.CloseButton = new_state
existing_state
= object.Closebutton

Arguments

object

Required.  A variable containing a dialog object created by calling CreateObject or new ActiveXControl.

new_state

Required. A True or False value.

existing_state

A variable to receive the True or False value.

Remarks
Make sure you provide another means to close the dialog box--such as a push button (using the AddButtons method)--before you remove the close button from the window..

Example

Sub main
  ' Create the dialog box
  Set Dialog = CreateObject("TPFSoftware.ScriptDialog")


 ' Add a row of buttons  Dialog.AddButtons "button", Array("OK", "Cancel")
 ' Remove the close button from the top-right  Dialog.CloseButton = False
 ' Display the dialog box  Set Result = Dialog.Execute
End Sub