使工具条菜单项用作复选框 [英] making tool strip menu item works as checkbox

查看:94
本文介绍了使工具条菜单项用作复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个启动表格,当主软件中的复选框已选中时,该表格便会起作用,
但我想使菜单的toolstrip菜单项可用作复选框,
我有此代码

i have a splash form which works when there is checkbox checked in the main software,
but i want to make the toolstrip menu item of menu works as checkbox,
i have this code

Properties.Settings.Default.ShowSplashScreen = checkBox1.Checked;


我把它做成


i made this as

Properties.Settings.Default.ShowSplashScreen = sETTINGToolStripMenuItem.Checked;


但是问题是.菜单项,即工具栏菜单,它没有保存我的checkstate.例如,使用复选框时,它保存了我的checkstate.并在菜单中我想保存检查状态以显示初始屏幕是否正常工作.

(或者是否有其他选项,例如启用和禁用工具栏菜单项以启用初始表格)


but the problem is. the menu item i.e toolstrip menu it is not saving my checkstate. for example when using checkbox, it saved my checkstate. and in menu i want to save the checkstate for showing that splash screen is working or not.
OR
( or is there another option like enabling and disabling the toolstrip menu item for enabing the splash form)

推荐答案

您需要将应用程序中的复选框状态保存到配置中文件/注册表/表,然后在启动应用程序时简单地从该数据源中读取该值.根据保存的值,您可以显示/隐藏初始屏幕.
注意:请勿从表单控件中读取该值,而是读取保存的配置值.
You need to save the checkbox state from your application into a configuration file/registry/table and then simply read that value from that datasource when you start up your application. Based on that saved value, you show/hide your splash screen.
NOTE: You DO NOT read the value from a form control to do this, you read the saved configuration value.


我已将其绑定到名为
的属性 应用程序设置及其完成
i have bound that to the propoerty named
application setting and its done


这篇关于使工具条菜单项用作复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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