I would like delete the value from TextBox 'txtName' by using a separate class 'Delete', with the methode .resetText(). i don't get access in this separate class to my TextBox. how can i solve this problem?
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void butDelete_Click(object sender, EventArgs e)
{
Delete delete = new Delete();
}
}
class Delete
{
public Delete()
{
txtName.ResetText();
}
}
Pass text box object as parameter.
class Delete
{
public Delete(TextBox txtName)
{
txtName.ResetText();
}
}