复选框已检查状态c#.net [英] Checkbox checkedstate c#.net

查看:48
本文介绍了复选框已检查状态c#.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的Windows窗体应用程序中,我有一个登录表单,其中包含2个用于用户名和密码的文本框以及复选框(以保持用户登录)。当用户第一次登录时,如果他选中了复选框,则它应该保持选中状态(我可以选择取消选中菜单项),即使关闭应用程序然后重新打开它。如何才能保持代码保持复选框的checkstate始终检查?..

Hello everyone,

In my windows form application iam having a login form with 2 textboxes for username and password and checkbox (to keep the user logged in). When the user login for the first time if he check the checkbox then it should remains checked(iam having a option to uncheck in a menu item) even when the applcation is closed and then reopen it. How can code to remain the checkedstate of the checkbox always checked ?..

推荐答案

你需要在某处保存你的值... ini文件,文本文件,配置文件,注册表...
You need to save your values someplace... ini file, text file, config file, registry...


您需要保存每个人的详细信息,然后在下次某人登录时检索它们。
you need to save the details for every person, then retrieve them the next time a certain person logs in..


你好,


我试图将复选框信息保存到配置文件中。我得到一个错误对象引用未设置为对象。下面是我的代码
hello,

I have tried to save the checkbox info to the config file. Iam getting a error "object reference is not set to an object". Below is my code
展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于复选框已检查状态c#.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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