Hi. I am posting this question again because the answer I got was "too" technical for me to understand..:D My understading of concepts is very basic. I am a bog standard amateur but I am very keen to learn graphics programming. But, for now I think I need answers in simple words.;) I would truly appreciate an example code, syntax or an illustration that can help my application scenario mentioned below.
Please also let me know about the changes I should make to my code given below.
The project has two windows.
The window1 has a bunch of textboxes and gets values from the user. For example, "age, runs scored, average, highest score, etc"
When the user clicks the submit button, the window2 should open.
I've achieved this by using "window2.show(); method"
The window2 is bit of a prat! It has a bunch of arrays. I want the values entered in the textboxes of window1 to be stored in the arrays of window2.
I came up with some preposterous syntactic ideas and ended in a fiasco.
one among them was this,
double[] average= new double[10];
average[0]=Window1.averagebox.text;
I was awarded with this error "An object reference is required for the non-static field, method, or property 'project12.Window1.averagebox'"
(i am guessing it also needs a conversion from string to double ? )
So, this is what i have in window1.cs
"public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void submit_Click(object sender, RoutedEventArgs e)
{
var Window2 = new Window2();
Window2.Show();
}
}"
And this is a part of my code from window2.cs
"public partial class Window2 : Window
{
public Window2()
{
InitializeComponent();
double average[10] =new double[10];
average[0]=Window1.averagebox.text;
}
}"
I might do something with the arrays in Window2 later but my primary objective right now is to access that "average" textbox from window1 and store it in window2's array.
Please help my clumsy code..!.
Cheers !