Joe Enos
unread,Oct 31, 2008, 2:04:28 PM10/31/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Your code must start somewhere non-static - for example, a
button_click event handler. From there, you can call a static method
and just pass the thing in.
Suppose the following:
You have a textbox with ID txt1. The code gets started by clicking
btn1.
public void btn1_Click(object sender, EventArgs e)
{
DoSomething(txt1);
}
public static void DoSomething(TextBox textBox)
{
textBox.Text = "AAA";
}
Working with the form is a little different - if you can stick with
the textbox only, that will be the easiest and probably the most
readable.