i am using visual studio 2008,c# winform. . .i want to change label's text on main form to the text entered on 2nd form's textbox and store it means when i re-execute my application it shows updated name actually i am trying to make best score system for my game. . . can anyone plz guide me.. . Thank you.
3 Answers
On the second form, you could save the value to the database or an xml file if you dont want have database need. First form could load the name from the xml file thus reflecting updated value. Suppose the application is running and in second form the name is updated, you could save the name to public static variable, the main form could check the variable for updated value may be every second, for that you could use the timer
control.
Hope this help

- 6,537
- 2
- 25
- 38
You could implement a function which writes the new high score's name to a text file (you'd have to read all the files current data, store it in a variable and re-add it with your new data unless you wanted to implement it differently).This function could be called whenever a new high score is entered.
Upon execution, the a method to read the file, identify the highest score and display it could be called. Store the highest in a variable and you know the rest....

- 13
- 2
There are so many methods to pass data between forms in windows application..
Using constructor
Using objects
Using properties
Using delegates
Check here PassingData and This

- 8,390
- 41
- 129
- 238