What you need is a property on the Label
Code:
namespace LabelTest
{
public partial class TestForm : Form
{
// get and set method for Label.Text
public string _Label
{
get
{
// Return Label.Text
return Label.Text;
}
set
{
// Set Label.Text with value
Label.Text = value;
}
}
public TestForm()
{
InitializeComponent();
}
}
Code:
class OtherClass
{
public void ChangeLabel()
{
// String with Text for Label
string setThisText = "Bla";
// Empty string
string getThisText;
// Attribute of Form
TestForm Test = new TestForm();
// Set method
Test._Label = setThisText;
// Get method (getThisText is now "Bla"
getThisText = Test._Label;
}
}
}