tangxu
2024-10-22 4d9fe5ed98ceb6b8fe9dc52ebfb80860ad1aee99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DPumpHydr.WinFrmUI.WenSkin.Controls;
using DPumpHydr.WinFrmUI.WenSkin.Forms;
 
namespace DPumpHydr.WinFrmUI.WenSkin
{
    public partial class PopupInputBoxForm : WenForm
    {
        public PopupInputBoxForm(string text,bool readOnly)
        {
            InitializeComponent();
            this.Message = text;
            this.ReadOnly = readOnly;
 
            this.StartPosition = FormStartPosition.CenterScreen;
            Size = new Size(500, 350);
            Text = "文本输入框";
 
            WenTextBox textBox = new WenTextBox()
            {
                Text = Message,
                Dock = DockStyle.Fill,
                Multiline = true,
                ScrollBars = ScrollBars.Both,
                WordWrap = false,
                ReadOnly = this.ReadOnly,
            };
            textBox.TextChanged += (s, e) =>
            {
                Message = textBox.Text;
            };
 
            WenButton button = new WenButton()
            {
                Text = "确定",
                Dock = DockStyle.Bottom,
            };
            button.Click += (s, ex) =>
            {
                this.DialogResult = DialogResult.OK;
            };
 
            this.Controls.Add(textBox);
            this.Controls.Add(button);
        }
 
        #region 私有属性
 
 
        #endregion
 
        #region 共有属性
 
        public string Message { get; set; }
        public bool ReadOnly { get; set; }
 
        #endregion
    }
}