I stretch my hair for a while
I created a form filled with image files. Each frame will contain the _click, _mousedown and _mouseup event. I want to move these events created for the form to class1.cs, and then inherit these form1.cs events.
I do not want to make Picturebox1 publicly available. so something like Class1 classOne = new Class1 (); pictureBox1.Click + = new EventHandler (cs.pictureBox1_Click); will not work.
I am not sure how to make form1.cs inherit from class1.cs. sounds so easy in my head, but im just in the mental blank
I'm tired of class Form1: Form, Class1
in Form1.Designer.cs this.pictureBox1.Click + = new System.EventHandler (this.pictureBox1_Click); this.pictureBox1_Click is not available
If you could point me in the right direction, that would be a big help! Greetings
Form1.cs
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
Class1.cs
class Class1
{
private void pictureBox1_Click(object sender, EventArgs e)
{
MessageBox.Show("pb1 click");
}
}
source
share