You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/Controls/Mesnac.Controls.Default/MCPanel.cs

45 lines
1.1 KiB
C#

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(MCPanel), "Resources.MCPanel.png")]
public partial class MCPanel : Panel
{
#region 字段定义
protected Assembly _assembly = Assembly.GetExecutingAssembly();
protected Stream _imageStream;
#endregion
#region 构造方法
public MCPanel()
{
InitializeComponent();
this.Size = new Size(116, 150);
_imageStream = _assembly.GetManifestResourceStream("Mesnac.Controls.Default.Resources.MCPanel.png");
this.BackgroundImage = Image.FromStream(_imageStream);
this.BackgroundImageLayout = ImageLayout.Stretch;
}
public MCPanel(IContainer container)
{
container.Add(this);
InitializeComponent();
}
#endregion
}
}