none
开发用户控件中,如何在属性栏显示"..."按钮,弹出设置窗体? RRS feed

答案

  • 你好:

    如果你给用户控件添加一个返回类型为集合的属性,属性栏会自动显示"...",比如:

    public partial class MyUserControl : UserControl
        {
            public MyUserControl()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                textBox1.Text = "Hello World";
            }
    
    
            [Description("Test text displayed in the textbox"), Category("Data")]
            public string CustomText
            {
                get { return textBox1.Text; }
                set { textBox1.Text = value; }
            }
    
            [Description("Test text displayed in the textbox"), Category("Data")]
            public List<string> CustomList
            {
                get;
                set;
            }
        }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • 已标记为答案 vboykk 2014年10月27日 10:36
    2014年10月27日 9:01
    版主