Changeset 15 for Common/Prompt.cs
- Timestamp:
- Jun 18, 2024, 12:15:33 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/Prompt.cs
r14 r15 139 139 public static bool ShowDialog(string text, string caption, object[] states, object initialValue, out object result) 140 140 { 141 int dataSize = 200;141 const int dataSize = 200; 142 142 Form prompt = new Form() 143 143 { … … 209 209 public static bool ShowDialog(string text, string caption, string initialValue, out string result, bool monospaceFont = false) 210 210 { 211 int dataSize = 200;211 const int dataSize = 200; 212 212 Form prompt = new Form() 213 213 { 214 214 Width = 500, 215 215 Height = 150 + dataSize, 216 FormBorderStyle = FormBorderStyle.FixedDialog, 217 Text = caption, 218 StartPosition = FormStartPosition.CenterScreen, 219 }; 220 Label textLabel = new Label() { Left = 50, Top = 20, AutoSize = true, Text = text }; 221 RichTextBox textBox = new RichTextBox() { Left = 50, Top = 44, Width = 400, Height = dataSize, Text = initialValue }; 216 FormBorderStyle = FormBorderStyle.Sizable, 217 Text = caption, 218 StartPosition = FormStartPosition.CenterScreen 219 }; 220 Label textLabel = new Label() { Left = 50, Top = 20, AutoSize = true, Text = text }; 221 RichTextBoxEx textBox = new RichTextBoxEx() 222 { 223 Left = 50, Top = 44, Width = 400, Height = dataSize, Text = initialValue, 224 Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left 225 }; 222 226 textBox.TextChanged += delegate 223 227 { … … 225 229 }; 226 230 textBox.SelectAll(); 227 Button confirmation = new Button() { Text = @"Ok", Left = 350, Width = 100, Top = dataSize + 70, DialogResult = DialogResult.OK }; 231 Button confirmation = new Button() 232 { 233 Text = @"Ok", Left = 350, Width = 100, Top = dataSize + 70, DialogResult = DialogResult.OK, 234 Anchor = AnchorStyles.Bottom | AnchorStyles.Right 235 }; 228 236 confirmation.Click += (sender, e) => { prompt.Close(); }; 229 237 prompt.Controls.Add(textBox);
Note:
See TracChangeset
for help on using the changeset viewer.