Changeset 15 for Common/Prompt.cs


Ignore:
Timestamp:
Jun 18, 2024, 12:15:33 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Updated files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/Prompt.cs

    r14 r15  
    139139        public static bool ShowDialog(string text, string caption, object[] states, object initialValue, out object result)
    140140        {
    141             int dataSize = 200;
     141            const int dataSize = 200;
    142142            Form prompt = new Form()
    143143            {
     
    209209        public static bool ShowDialog(string text, string caption, string initialValue, out string result, bool monospaceFont = false)
    210210        {
    211             int dataSize = 200;
     211            const int dataSize = 200;
    212212            Form prompt = new Form()
    213213            {
    214214                Width = 500,
    215215                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            };
    222226            textBox.TextChanged += delegate
    223227            {
     
    225229            };
    226230            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            };
    228236            confirmation.Click += (sender, e) => { prompt.Close(); };
    229237            prompt.Controls.Add(textBox);
Note: See TracChangeset for help on using the changeset viewer.