在运行时更改checkbox.checked并存储. [英] change checkbox.checked during runtime and store .

查看:102
本文介绍了在运行时更改checkbox.checked并存储.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户能够在运行时更改checkbox.checked属性,并且此属性存储下一次运行的应用程序.
我正在使用C#和Windows窗体应用程序.

I want to user be able to change checkbox.checked properties during run time and this property store for next time application Run.
I am using C# and windows form application.

推荐答案

您可以通过从返回truetruecheckbox.checked获取值来获取复选框的值. false.您可以将值保存在文本文件或数据库中,具体取决于您要执行的操作.启动应用程序时,可以从文本文件或数据库中加载值(取决于保存用户选择的位置).
You can get the value of the check box by getting the value from checkbox.checked which returns either true or false. You can save the value either in a text file or in a database, depends on what you really want to do. When your application is started, you can load the value from the text file or database (depends on where you are saving the user''s choice).


您可以使用设置资源:
如何在C#中使用设置类 [ http://msdn.microsoft.com/en-us/library/system. configuration.configurationmanager.appsettings.aspx [ ^ ]

干杯
You could use the settings resource :
How To Use the Settings Class in C#[^]

Alternatively use an app.config and appSettings :
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.appsettings.aspx[^]

Cheers


这篇关于在运行时更改checkbox.checked并存储.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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