how to add form into dll and Inject to show form ?
i trial this code
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ClassLibrary1
{
public class Class1
{
System.Windows.Forms.Form Fo = new System.Windows.Forms.Form();
public void Main()
{
Fo.Show();
}
public void New()
{
Fo.Show();
}
public void Form(ref System.Windows.Forms.Form Fr)
{
Fo.FormBorderStyle = FormBorderStyle.None;
Fo.BackColor = System.Drawing.Color.Red;
Fo.Size = new System.Drawing.Size(224, 268);
Fr.Controls.Add(Fo);
Fo.Show();
}
public void Items(ref System.Windows.Forms.Form Add)
{
System.Windows.Forms.Button btn = new System.Windows.Forms.Button();
btn.Location = new System.Drawing.Point(34, 105);
btn.Size = new System.Drawing.Size(40, 20);
btn.Text = "Button1";
Add.Controls.Add(btn);
}
}
}
but not work and remove class , add form not work too i can't Inject it