Well, this is my first application for Windows forms, and I have to face some difficulties restructuring my code. started putting everything in a class Form1that was provided by default, it quickly became too big. I know that this is a pretty bad programming practice, so I started cleaning and made different classes to satisfy the principle of single responsibility. however, since some button-related and network-related events work well in the classroom Form1, fetching them from the outside causes them to fail, and I don't know how this should be done.
public partial class Form1
{
public Form1()
{
InitializeComponent();
}
private void method1(object sender, EventArgs e)
{
}
private void method2(object sender, DataGridViewCellEventArgs e)
{
}
private void method3(object sender, EventArgs e)
{
}
}
method1, method2, method3 .. ( ), , , . , private , , Form1. , , onClick: Newclass.method1(), . , , Form1 onClick: thisMethodCallsTheOneINeedInADifferentClass(), ... , , , . , .