public class PictureEditEx : PictureEdit
{
public PictureEditEx()
{
this.SetStyle(ControlStyles.Selectable, false);
}
private ImageTextControl[] ListButton = new ImageTextControl[] { };
public ImageTextControl[] Buttons
{
get { return this.ListButton; }
set
{
this.ListButton = value;
//Invalidate();
foreach (ImageTextControl ctr in ListButton)
{
this.Controls.Add(ctr);
}
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
//if (ListButton.Length > 0)
//{
// foreach (Button mbtn in ListButton)
// {
// ControlPaint.DrawButton(e.Graphics, new Rectangle(mbtn.Location, mbtn.Size), ButtonState.Normal);
// }
//}
}
private ImageTextControlCollection mlist = null;
protected override Control.ControlCollection CreateControlsInstance()
{
//return base.CreateControlsInstance();
if (mlist == null)
mlist = new ImageTextControlCollection(this);
return mlist;
}
}PictureEditEx
最新推荐文章于 2022-05-10 22:15:44 发布
本文介绍了一个自定义的图片编辑控件类PictureEditEx,该类继承自PictureEdit,并添加了不可选中样式及按钮集合的功能。文章详细展示了如何在构造函数中设置控件样式,在属性中管理按钮集合,并在Paint事件中绘制这些按钮。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Qwen-Image-Edit-2509
图片编辑
Qwen
Qwen-Image-Edit-2509 是阿里巴巴通义千问团队于2025年9月发布的最新图像编辑AI模型,主要支持多图编辑,包括“人物+人物”、“人物+商品”等组合玩法
934

被折叠的 条评论
为什么被折叠?



