The following example displays a form and a button. When the button is clicked, a ColorDialog is presented to the user. If the user presses the OK button, the background color of the form is changed to the color selected by the user.

Break On $System = CreateObject("Kixtart.System") $Form = $System.Form() $Form.Button1 = $Form.Controls.Add("Button") $Form.Button1.Text = "ColorDialog" $Form.Button1.Center $Form.Button1.OnClick = "OnButtonClick()" $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1 Function OnButtonClick() Dim $ColorDialog $ColorDialog = $System.ColorDialog() $ColorDialog.Color = $Form.BackColor If $ColorDialog.ShowDialog = $System.DialogResult.OK $Form.BackColor = $ColorDialog.Color Endif EndFunction

The CHM file was converted to HTML by chm2web software.