zoukankan      html  css  js  c++  java
  • 四章

    1.  什么是MDI

    2. 读取和 获取文件路径的几种方法

    当需要快速输入信息时,有三种方法:

           1)     在key_down事件    if(e.keycode==keys.enter){this.textbox2.focus();}

           2)    private void textBox3_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    this.SelectNextControl(this.ActiveControl, true, true, true, true);
                }
            }

           3)

    3.  窗体间传递复杂数据

         1)  构造传递    创建两个窗体,在form2重载构造函数,再在form1中调用

                public Form2(string msg)
            {
                InitializeComponent();
                label1.Text = msg;
            }

     private void button2_Click(object sender, EventArgs e)
            {
                Form2 f2 = new Form2(textBox5.Text.Trim());
                f2.Show();
            }

        2)  公有字段传递   在form2中写一个公共属性

    public string Msg
            {
                get{     return label1.Text.Trim();}
                set{   label1.Text = value;}
            }
            public Form2(Form1 f1)  //重载
            {
                InitializeComponent();
                label1.Text = f1.MSG;   //把textBox5的值传给form2中的label1
            }

      form1 中public string MSG
            {
                get {  return textBox5.Text.Trim(); }
            }

        3)  又是委托与事件,很重要啊...

       

           

  • 相关阅读:
    Linux useradd 命令介绍
    lsscsi
    安装MegaCli,查看linux服务器raid信息
    ipmitool命令详解
    python 收发邮件
    angularjs 高级玩法 创建递归的模板
    我的Android进阶之旅------>Android Activity的singleTask载入模式和onActivityResult方法之间的冲突
    Git实战(三)环境搭建
    使用Samba实现Linux与Windows文件共享实践
    设计模式个人备忘(享元模式,strategy, templete strategy)
  • 原文地址:https://www.cnblogs.com/dfg1609887373/p/7630086.html
Copyright © 2011-2022 走看看