你好,此问题和研发沟通了一下,可以用下面的代码实现在加载Spread控件前,调用下面的代码,其中的静态方法GetDesignerKey也在下面,建议可以重写spread控件的OnLoad事件,在base.OnLaod(e)之前写入
- RegistryKey designerKey = GetDesignerKey();
- try
- {
- designerKey.SetValue("StartupScreen", "False", Microsoft.Win32.RegistryValueKind.String);
- }
- catch
- { }
- finally
- {
- if (designerKey != null)
- {
- designerKey.Close();
- }
- }
复制代码
- private static RegistryKey GetDesignerKey()
- {
- RegistryKey softwareKey = null;
- RegistryKey settingsKey = null;
- RegistryKey designKey = null;
- RegistryKey StartupKey = null;
- try
- {
- softwareKey = Registry.CurrentUser.OpenSubKey("Software", true);
- // VB and VBA Program Settings
- settingsKey = softwareKey.OpenSubKey("VB and VBA Program Settings", true);
- if (settingsKey == null)
- {
- softwareKey.CreateSubKey("VB and VBA Program Settings");
- settingsKey = softwareKey.OpenSubKey("VB and VBA Program Settings", true);
- } // Spread grid key
- designKey = settingsKey.OpenSubKey("FarPoint.Win.Spread.Design", true);
- if (designKey == null)
- {
- settingsKey.CreateSubKey("FarPoint.Win.Spread.Design");
- designKey = settingsKey.OpenSubKey("FarPoint.Win.Spread.Design", true);
- }
- StartupKey = designKey.OpenSubKey("Startup", true);
- if (StartupKey == null)
- {
- designKey.CreateSubKey("Startup");
- StartupKey = designKey.OpenSubKey("Startup", true);
- }
- }
- catch
- {
- }
- finally
- {
- if (settingsKey != null)
- {
- settingsKey.Close();
- }
- if (designKey != null)
- {
- designKey.Close();
- }
- }
- return StartupKey;
- }
复制代码
|