Storing values entered in text box in a file

entityx

Member
Joined
Oct 7, 2005
Messages
6
Location
Thermal, CA
Programming Experience
Beginner
I've written a screensaver program in VB.Net 2003. When the program is started the user is asked to enter the screen resolution that their computer is set to in 2 text boxes. For instance 1024 x 768. When they click on a start button on the form the values in the text boxes are used for two variables in the program.
How can I store the values entered in the text boxes in a file and then call up the file the next time the program is started and set the variables in the program equal to the values stored in the file. I'd like to establish the name of the file myself so the user won't be asked to name the file.
I hope this question hasn't been asked too many hundred times.
One other question in an unrelated area. How to get a full screen display for my screen saver program so you don't see the task bar at the bottom and a title bar at the top of the screen. Mouse movement causes the program to end so the exit box at the upper right isn't necessary.
I've just been programming this year so I have a lot to learn.
 
You don't have to, nor should you, ask the user to supply their screen resolution. It can change and the user is not guaranteed to enter the correct values. Use the Screen.PrimaryScreen.Bounds to get a Rectangle object that represents the screen, whose dimensions will give you the screen resolution. Here are some links related to creating genuine screensavers:

http://msdn.microsoft.com/vstudio/express/vb/starterkit/default.aspx
http://www.microsoft.com/downloads/...f5-01d8-4246-b755-5237e08b0016&displaylang=en

Note that the starter kit is for VB 2005, but you can get the Express edition for free if you haven't already got it.
 
Thank you very much for your answer. Very helpful. In my program I set :
Xlimit = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
Ylimit = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height

This is very easy to use and bypasses the other problems I was considering. Much Thanks
I still have to look into your other recommendations about the links for creating screensavers.
 
Back
Top