I created a Form1 form including a label1. Also I created a class1 file. When Form1 load the startFunction methos will be triggered by the Form1_Load event. startFunction is a inherited method.
namespace MyNameSpace
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load (object sender, EventArgs e)
{
StartMethod();
}
public void startMethod()
{
Class1 ClasInherited = new Class1();
ClasInherited.ChangeLabelText();
}
.
.
Class1.cs file include ChangeLabelText() method.
public partial class Class1
{
Form1 form1 = new YuzeyAnaliz();
public void ChangeLabelText()
{
form1.label5.Text = "Text changed";
}
.
.
However label5 text doesnt change. I am missing something.