现在我有一个自定义控件 里面有一个自定义的枚举类型属性,怎么让这个属性像 TextAlign属性一样 在属性编辑器里面那样选择呀?
/// <summary>
/// 标题文字位置
/// </summary>
[Category("1、自定义属性"), Description("标题文字位置")]
[Localizable(true)]
public ContentPosition ContentPosition
{
get
{
return contentPosition;
}
set
{
contentPosition = value;
this.Invalidate();
}
}
/// <summary>
/// 标题文字位置
/// </summary>
public enum ContentPosition
{
/// <summary>
/// 上边靠左
/// </summary>
Top_Left = 0,
/// <summary>
/// 上边中间
/// </summary>
Top_Center,
/// <summary>
/// 上边靠右
/// </summary>
Top_Right,
/// <summary>
/// 左边靠上
/// </summary>
Left_Top,
/// <summary>
/// 左边中间
/// </summary>
Left_Center,
/// <summary>
/// 左边靠下
/// </summary>
Left_Bottom,
/// <summary>
/// 下边靠左
/// </summary>
Bottom_Left,
/// <summary>
/// 下边中间
/// </summary>
Bottom_Center,
/// <summary>
/// 下边靠右
/// </summary>
Bottom_Right,
/// <summary>
/// 右边靠上
/// </summary>
Right_Top,
/// <summary>
/// 右边中间
/// </summary>
Right_Center,
/// <summary>
/// 右边靠下
/// </summary>
Right_Bottom
}
结果总是这样 每次调整还得往下拉 ,稍微多一点就比较麻烦
想实现这种效果该怎么写