поэтому раньше мне приходилось создавать библиотеку, но исходный код был хранится на жестком диске, который был поврежден, поэтому я попытался декомпилировать из библиотеки, но проблема заключалась в том, что образ ресурса не был обнаружен, поэтому возникла ошибка, поэтому я опубликовал образец того, как я сделал изображение ComponentResourceManager автоматически для каждого пользовательского компонента.
Пожалуйста, помогите
Спасибо
код в testimage.Designer.cs
Код: Выделить всё
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Resources;
using System.Windows.Forms;
namespace testimagelibrary
{
[DebuggerStepThrough]
[DefaultEvent("Click")]
[ProvideProperty("testimage", typeof(Control))]
public class testimage : PictureBox
{
private int _Zoom = 10;
private System.Drawing.Image _imgActive = null;
private System.Drawing.Image _tmp = null;
private IContainer components = null;
public System.Drawing.Image ImageActive
{
get
{
return this._imgActive;
}
set
{
this._imgActive = value;
}
}
public int Zoom
{
get
{
return this._Zoom;
}
set
{
this._Zoom = value;
}
}
public testimage()
{
this.InitializeComponent();
}
protected override void Dispose(bool disposing)
{
if ((!disposing ? false : this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(testimage));
((ISupportInitialize)this).BeginInit();
base.SuspendLayout();
base.Image = (System.Drawing.Image)componentResourceManager.GetObject("this.Image");
base.Size = new System.Drawing.Size(71, 71);
base.SizeMode = PictureBoxSizeMode.Zoom;
((ISupportInitialize)this).EndInit();
base.ResumeLayout(false);
}
}
}



Подробнее здесь: https://stackoverflow.com/questions/790 ... custom-com