Click here to Skip to main content
15,890,946 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WP7 using silverlight Pin
Dan Mos24-Aug-11 0:48
Dan Mos24-Aug-11 0:48 
GeneralRe: WP7 using silverlight Pin
arkiboys24-Aug-11 1:40
arkiboys24-Aug-11 1:40 
Question"Embed" an external video clip Pin
McCombi23-Aug-11 22:18
McCombi23-Aug-11 22:18 
AnswerRe: "Embed" an external video clip Pin
Navin Pandit23-Aug-11 22:34
Navin Pandit23-Aug-11 22:34 
GeneralRe: "Embed" an external video clip Pin
McCombi23-Aug-11 22:49
McCombi23-Aug-11 22:49 
GeneralRe: "Embed" an external video clip Pin
Navin Pandit23-Aug-11 23:50
Navin Pandit23-Aug-11 23:50 
AnswerRe: "Embed" an external video clip Pin
McCombi24-Aug-11 3:07
McCombi24-Aug-11 3:07 
QuestionWPF help- how to access a textbox value from a different window Pin
steersteer22-Aug-11 11:17
steersteer22-Aug-11 11:17 
Hi. I am quite new to WPF programming (basically programming itself) but I like learning it. I am working on a silly project that 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..!.Smile | :)

Cheers !
AnswerRe: WPF help- how to access a textbox value from a different window Pin
Mycroft Holmes22-Aug-11 13:09
professionalMycroft Holmes22-Aug-11 13:09 
GeneralRe: WPF help- how to access a textbox value from a different window Pin
steersteer22-Aug-11 13:47
steersteer22-Aug-11 13:47 
GeneralRe: WPF help- how to access a textbox value from a different window Pin
Mycroft Holmes22-Aug-11 14:04
professionalMycroft Holmes22-Aug-11 14:04 
QuestionLosing expanded nodes in TreeView after ItemsSource has updated Pin
Mc_Topaz21-Aug-11 21:58
Mc_Topaz21-Aug-11 21:58 
AnswerRe: Losing expanded nodes in TreeView after ItemsSource has updated Pin
Mycroft Holmes21-Aug-11 22:42
professionalMycroft Holmes21-Aug-11 22:42 
GeneralRe: Losing expanded nodes in TreeView after ItemsSource has updated Pin
Mc_Topaz22-Aug-11 1:48
Mc_Topaz22-Aug-11 1:48 
GeneralRe: Losing expanded nodes in TreeView after ItemsSource has updated Pin
Mycroft Holmes22-Aug-11 12:20
professionalMycroft Holmes22-Aug-11 12:20 
Questionapple mac laptop Pin
arkiboys20-Aug-11 0:13
arkiboys20-Aug-11 0:13 
AnswerRe: apple mac laptop Pin
Mehdi Gholam20-Aug-11 0:39
Mehdi Gholam20-Aug-11 0:39 
GeneralRe: apple mac laptop Pin
arkiboys20-Aug-11 5:50
arkiboys20-Aug-11 5:50 
AnswerRe: apple mac laptop Pin
BubingaMan5-Sep-11 4:33
BubingaMan5-Sep-11 4:33 
QuestionSilverlight with DevExpress Grid Control Pin
brijmohansingh1018-Aug-11 20:07
brijmohansingh1018-Aug-11 20:07 
AnswerRe: Silverlight with DevExpress Grid Control Pin
Abhinav S20-Aug-11 1:45
Abhinav S20-Aug-11 1:45 
QuestionNeed some Simple Code Pin
peterdrozd15-Aug-11 6:49
peterdrozd15-Aug-11 6:49 
AnswerRe: Need some Simple Code Pin
Kevin Marois15-Aug-11 10:25
professionalKevin Marois15-Aug-11 10:25 
AnswerRe: Need some Simple Code Pin
SledgeHammer0115-Aug-11 10:41
SledgeHammer0115-Aug-11 10:41 
GeneralRe: Need some Simple Code Pin
Kevin Marois15-Aug-11 11:52
professionalKevin Marois15-Aug-11 11:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.