using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing; using System.Reflection; using System.IO; namespace Mesnac.Controls.Default { [ToolboxBitmap(typeof(MCPanelBlack), "Resources.MCPanel1.png")] public partial class MCPanelBlack : Panel { #region 字段定义 protected Assembly _assembly = Assembly.GetExecutingAssembly(); protected Stream _imageStream; #endregion #region 构造方法 public MCPanelBlack() { InitializeComponent(); this.Size = new Size(226, 206); _imageStream = _assembly.GetManifestResourceStream("Mesnac.Controls.Default.Resources.MCPanel1.png"); this.BackgroundImage = Image.FromStream(_imageStream); this.BackgroundImageLayout = ImageLayout.Stretch; } public MCPanelBlack(IContainer container) { container.Add(this); InitializeComponent(); } #endregion } }