我如何保存按钮数组 [英] How can i save the button array

查看:125
本文介绍了我如何保存按钮数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我有这段代码,允许用户创建一个按钮数组,其中的任何一个均来自from.我可以给2个链接,以便你们可以休整一下
首先 [ http://rapidshare.com/files/424453759/ManageControls.zip [

Hello
I have this code that allow the user to create a button array, any were in a from. I can give 2 links so you guys can fallow what its done
first [MSDN]
and second here http://rapidshare.com/files/424453759/ManageControls.zip[^] this one is a Simple sample of what I am doing (on Create an account now?Click NO and then download the zip file it takes 2 seconds I am working on version 2010 but there is a 2008 back up )
The Problem or questions is as follow
I need to save what ever the user make for example if he added 5 buttons and save it next time when he opens his saved file he will see the 5 button in the same place he save them.
This will allow the user to send the file to another person with the same program and the other person take a look at the created file.
I am working with c# 3.5 .net windows form app x86 if you need any more info please ask.
this one is a Simple sample of what I am doing
The Problem or questions is as follow
I need to save what ever the user make for example if he added 5 buttons and save it next time when he opens his saved file he will see the 5 button in the same place he save them.
This will allow the user to send the file to another person with the same program and the other person take a look at the created file.

I am working with c# 3.5 .net windows form app x86 if you need any more info please ask.

THANKS in ADVANCE

推荐答案

您需要使用一个数据库,您可以在其中存储添加的按钮数量及其位置.该数据库不必是完整的数据库.即使是一个小的文本文件(用于存储配置)也可以.

用户第一次关闭应用程序时,请将这些值保存在配置文件中.

下次,当应用程序加载时,从文件中读取这些内容后,从文件中加载这些值并显示按钮(及其位置).
You need to use a database where you can store the number of buttons added and their locations. This need not be a full fledged database. Even a small text file (to store the configuration) will do.

First time when the user closes the application, save these values in the configuration file.

Next time, when the application loads, load these values from the file and display the buttons (and their locations) after reading these contents from the file.


这篇关于我如何保存按钮数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆