Break On $System = CreateObject("Kixtart.System"); ; Create a new instance of the form. $form1 = $System.Form(); ; Create two buttons to use as the accept and cancel buttons. $button1 = $form1.Controls.Add("Button") $button2 = $form1.Controls.Add("Button") ; Set the text of button1 to "OK". $button1.Text = "OK"; ; Set the position of the button on the form. $button1.Location = 10,10 ; Set the text of button2 to "Cancel". $button2.Text = "Cancel"; ; Set the position of the button based on the location of button1. $button2.Location = $System.Point ($button1.Left, $button1.Height + $button1.Top + 10); ; Make button1's dialog result OK. $button1.DialogResult = $System.DialogResult.OK; ; Make button2's dialog result Cancel. $button2.DialogResult = $System.DialogResult.Cancel; ; Set the caption bar text of the form. $form1.Text = "My Dialog Box"; ; Define the border style of the form to a dialog box. $form1.FormBorderStyle = $System.FormBorderStyle.FixedDialog; $form1.StartPosition = $system.formStartPosition.centerScreen; ; Set the accept button of the form to button1. $button1.default = true; $button2.cancel = true; $= $form1.ShowDialog(); ; Determine if the OK button was clicked on the dialog box. if ($form1.DialogResult = $System.DialogResult.OK) ; Display a message box indicating that the OK button was clicked. $= $System.MessageBox.Show("The OK button on the form was clicked."); else ; Display a message box indicating that the Cancel button was clicked. $= $System.MessageBox.Show("The Cancel button on the form was clicked."); endif




The CHM file was converted to HTML by chm2web software.