码迷,mamicode.com
首页 > 其他好文 > 详细

自定义控件

时间:2017-05-18 18:41:36      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:val   initial   content   标题   namespace   his   space   style   private   

namespace WindowsFormsApplication5
{
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }
        public UserControl1(object oo)
        {
            MyUser myUser = new MyUser();
            myUser = (MyUser)oo;
            InitializeComponent();
            this.label1.Text = "标题" + myUser.Name;
            this.textBox1.Text = myUser.Content;
        }
    }
    public class MyUser
    { 
       private  string name;
       public string Name
       {
           set { name = value; }
           get { return name; }
       }
       private string content;
       public string Content
       {
           set { content = value;}
           get { return content; }
       }


    }
}

 

自定义控件

标签:val   initial   content   标题   namespace   his   space   style   private   

原文地址:http://www.cnblogs.com/mamiyiya777/p/6874694.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!