使工具条菜单项用作复选框
我有一个启动表格,当主软件中的复选框已选中时,该表格便会起作用,
但我想使菜单的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