基本信息
源码名称:C# 属性控件(PropertyGridApp)的例子
源码大小:0.04M
文件格式:.rar
开发语言:C#
更新时间:2019-04-16
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍

 【实例源码】PropertyGridApp的例子

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;

namespace PropertyGridApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            propertyGrid1.SelectedObject = new Go();
        }

        class Go
        {
            private float _TieMu = 5.5f;
            private string _Rule = "数子法";
            [CategoryAttribute("规则"), DescriptionAttribute("贴目")]
            public float TieMu
            {
                get { return _TieMu; }
                set { _TieMu = TieMu; }
            }
            [CategoryAttribute("规则"), DescriptionAttribute("计算法")]
            public string Rule
            {
                get { return _Rule; }
                set { _Rule = Rule; }
            }

            private int _Black = 0;
            private int _White = 0;
            [CategoryAttribute("围棋"), DescriptionAttribute("黑")]
            public int Black
            {
                get { return _Black; }
                set { _Black = Black; }
            }
            [CategoryAttribute("围棋"), DescriptionAttribute("白")]
            public int White
            {
                get { return _White; }
                set { _White = White; }
            }

            private Color _BoardColor = Color.Yellow;
            [CategoryAttribute("围棋"), DescriptionAttribute("棋盘颜色")]
            public Color BoardColor
            {
                get { return _BoardColor; }
                set { _BoardColor = BoardColor; }
            }

            private Image _Background;
            [CategoryAttribute("围棋"), DescriptionAttribute("棋盘背景")]
            public Image Background
            {
                get { return _Background; }
                set { _Background = Background; }
            }

        }
    }
}