Hello every one. I have a quick question. I working in a small project to learn C#. My background is VB and working C# is sort on and off thing, but I want to learn more. Here is question. I have button a put
form that used to move an object forward and to certain point and then move it back to the beginning. I have the logic correct however I need to reused code so I need to create a procedure (It I believe it is call Class in C# since it does return any values). I know that in C# a class can not be call directly so instance must be made. Ideally would be to to have procedure in side that button but I can seem to figure it how. On thing is that not want any value returned back. I need something like what is below which does not work. Any ideas on this?
// ** Call MoveObject
MoveObject()
// **** Create Class
class MoveObject
{
// ** Code to move object is placed here.
}
form that used to move an object forward and to certain point and then move it back to the beginning. I have the logic correct however I need to reused code so I need to create a procedure (It I believe it is call Class in C# since it does return any values). I know that in C# a class can not be call directly so instance must be made. Ideally would be to to have procedure in side that button but I can seem to figure it how. On thing is that not want any value returned back. I need something like what is below which does not work. Any ideas on this?
// ** Call MoveObject
MoveObject()
// **** Create Class
class MoveObject
{
// ** Code to move object is placed here.
}