话不多说直接贴的代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace ExcelOperator
{
public class SpaceButton:Button
{
//传统.NET做法 私有字段搭配一个公开属性(Text属性)
string txt;
{
public class SpaceButton:Button
{
//传统.NET做法 私有字段搭配一个公开属性(Text属性)
string txt;
public string Text
{
set { txt = value; Content = SpaceOutText(txt); }
get { return txt; }
}
{
set { txt = value; Content = SpaceOutText(txt); }
get { return txt; }
}
//依赖属性 (表示字符间距)
public static readonly DependencyProperty SpaceProperty;
public static readonly DependencyProperty SpaceProperty;
//.NET属性包装器
public int Space
{
set { SetValue(SpaceP
public int Space
{
set { SetValue(SpaceP