Windows Forms Application Help

I just started tinkering with Windows Forms yesterday so i appologize in advance for the noob questions.
So it seems that creating a GUI is really easy in VS2010, it is basically a drag and drop from toolbox. However i was not able to figure out how to link any forms to an actual function or array.

Let's say we have the simple following code:

1
2
3
4
5
6
7
8
int myArray1[5]={0,0,0,0,0}, myArray2[5]={0,0,0,0,0}; // global arrays
int MyFunc()
{
  int mySum=0;
  for(int i=0; i<5; ++i)
      mysum+=myArray1[i]*myarray2[i];
  return mySum;
}


So my first question if I create a "NumericUpDown" form, how do link it to one of the elements from myArray1 or myArray2 so that when the value changed by the user is assigned to that element.

My second question is after I create a button, how do i assign MyFunc() to that button so that the function is executed when that button is clicked.

Third question, I couldn't figure out which Windows forms to use that would display the returned value from myFunc.

Thanks in advance,
Last edited on
Take a look at the essays at this site: http://www.flounder.com/mvp_tips.htm.
so i appologize in advance for the noob questions

there's nothing to forgive, everybody have their own problem (and way of thinking), so feel free to ask whatever you want to ask (no matter how silly it sounds)...
Topic archived. No new replies allowed.