PictureEditEx
来源:互联网 发布:js颜色r g b 编辑:程序博客网 时间:2024/06/05 02:54
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; } }
0 0