首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

Win Form中如何样实现编辑文本并将其显示在窗口中

2013-05-02 
Win Form中怎么样实现编辑文本并将其显示在窗口中大致是一个Form1窗口实现编辑文本,然后将编辑好的文本显

Win Form中怎么样实现编辑文本并将其显示在窗口中
大致是一个Form1窗口实现编辑文本,然后将编辑好的文本显示在Form2中
[解决办法]
Form1中的代码

Form2 f2 = New Form2();
f2.Text = Textbox1.Text.Trim();    Form2窗体名称显示为Form1窗体中的Textbox1输入的值

[解决办法]
引用:
Form1中的代码


C# code
?



12

Form2 f2 = New Form2(); f2.Text = Textbox1.Text.Trim();    Form2窗体名称显示为Form1窗体中的Textbox1输入的值



用1L的方法就可以了。具体实习代码如下

private void button1_Click(object sender, EventArgs e)
        {
            Form10 form = new Form10();
            form.testValue = this.textBox1.Text;
            form.ShowDialog();
        }

窗体1中的代码。窗体1中就放了个文本框和一个按钮

public Form10()
        {
            InitializeComponent();
        }

        public string testValue { get; set; }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Form10_Load(object sender, EventArgs e)
        {
            this.textBox1.Text = testValue;
        }


[解决办法]
http://bbs.csdn.net/topics/360140208

热点排行