0
now sure if this is what you are looking for...
ButtonAddOrder_Click(...)
{
THIS IS THE CODE I HAVE: StreamWriter myWriter new StreamWriter("customer.txt"); MyWriter.WriteLine(txtName.Text); MyWriter.Close();
If(addOrder == DialogResult.yes)
{ why dont you call a function here...like myfunc() }
}
Myfunc()
{
DO COMMON TASK HERE
}
Accepted 0
great that it worked for you, also you are not stupid ; any question big or small is legit.
0
I think I know what you mean... I Create a Function or Procedure then call it in both the button and if statement!!!
Thanx man!!!
Lol, I'm stupid....
0
Hi Dillion,
you question is not clear, may be you can elaborate more or give us some examples. For what i understand is you want to write a common routine and you want to call that on any event, like button click, etc. So I am not sure if you just create a Sub/Function and pass the object as the parameter and run your routine based on the object's decision.