The following example displays a Form with a Textbox and a Button. When the user clicks the button, a FontDialog is displayed asking the user to select a new Font. If the user clicks OK, the new font style is used by the textbox.

Break On $System = CreateObject("Kixtart.System") $Form = $System.Form() $Form.TextBox1 = $Form.Controls.Add("TextBox") $Form.TextBox1.MultiLine = 1 $Form.TextBox1.Width = $Form.ClientWidth - 20 $Form.TextBox1.Height = 0.75 * $Form.ClientHeight $Form.TextBox1.Center $Form.TextBox1.Top = 10 $Form.TextBox1.Text = "The quick brown Fox jumped over the lazy moon." $Form.TextBox1.Anchor = $System.AnchorStyles.All $Form.Button1 = $Form.Controls.Add("Button") $Form.Button1.Text = "Font" $Form.Button1.Center $Form.Button1.Top = $Form.TextBox1.Bottom + 10 $Form.Button1.OnClick = "OnButtonClick()" $Form.Button1.Anchor = $System.AnchorStyles.BottomRight $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1 Function OnButtonClick Dim $FontDialog $FontDialog = $System.FontDialog() $FontDialog.Font = $Form.TextBox1.Font If $FontDialog.ShowDialog = $System.DialogResult.OK $Form.TextBox1.Font = $FontDialog.Font Endif EndFunction

The CHM file was converted to HTML by chm2web software.