找回密码
 立即注册

QQ登录

只需一步,快速开始

cccc

金牌服务用户

6

主题

12

帖子

56

积分

金牌服务用户

积分
56
cccc
金牌服务用户   /  发表于:2021-9-27 14:19  /   查看:1967  /  回复:1
1金币

下面这个框在开发环境没有,但是在用户环境下却有,而且勾选去掉,下一次打开仍然会弹,请问怎么解决,急
4IK85`)P6[FYKH8BX4(CO~E.png563128661.png

最佳答案

查看完整内容

你好,此问题和研发沟通了一下,可以用下面的代码实现在加载Spread控件前,调用下面的代码,其中的静态方法GetDesignerKey也在下面,建议可以重写spread控件的OnLoad事件,在base.OnLaod(e)之前写入

1 个回复

倒序浏览
最佳答案
最佳答案
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-9-27 14:20:00
来自 2#
你好,此问题和研发沟通了一下,可以用下面的代码实现在加载Spread控件前,调用下面的代码,其中的静态方法GetDesignerKey也在下面,建议可以重写spread控件的OnLoad事件,在base.OnLaod(e)之前写入
image.png109126891.png
  1. RegistryKey designerKey = GetDesignerKey();
  2.             try
  3.             {
  4.                 designerKey.SetValue("StartupScreen", "False", Microsoft.Win32.RegistryValueKind.String);
  5.             }
  6.             catch
  7.             { }
  8.             finally
  9.             {
  10.                 if (designerKey != null)
  11.                 {
  12.                     designerKey.Close();
  13.                 }
  14.             }
复制代码




  1. private static RegistryKey GetDesignerKey()
  2.         {
  3.             RegistryKey softwareKey = null;
  4.             RegistryKey settingsKey = null;
  5.             RegistryKey designKey = null;
  6.             RegistryKey StartupKey = null;
  7.             try
  8.             {
  9.                 softwareKey = Registry.CurrentUser.OpenSubKey("Software", true);
  10.                 // VB and VBA Program Settings
  11.                 settingsKey = softwareKey.OpenSubKey("VB and VBA Program Settings", true);
  12.                 if (settingsKey == null)
  13.                 {
  14.                     softwareKey.CreateSubKey("VB and VBA Program Settings");
  15.                     settingsKey = softwareKey.OpenSubKey("VB and VBA Program Settings", true);
  16.                 }        // Spread grid key
  17.                 designKey = settingsKey.OpenSubKey("FarPoint.Win.Spread.Design", true);
  18.                 if (designKey == null)
  19.                 {
  20.                     settingsKey.CreateSubKey("FarPoint.Win.Spread.Design");
  21.                     designKey = settingsKey.OpenSubKey("FarPoint.Win.Spread.Design", true);
  22.                 }
  23.                 StartupKey = designKey.OpenSubKey("Startup", true);
  24.                 if (StartupKey == null)
  25.                 {
  26.                     designKey.CreateSubKey("Startup");
  27.                     StartupKey = designKey.OpenSubKey("Startup", true);
  28.                 }
  29.             }
  30.             catch
  31.             {
  32.             }
  33.             finally
  34.             {
  35.                 if (settingsKey != null)
  36.                 {
  37.                     settingsKey.Close();
  38.                 }
  39.                 if (designKey != null)
  40.                 {
  41.                     designKey.Close();
  42.                 }
  43.             }
  44.             return StartupKey;
  45.         }
复制代码


回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部