当前位置:编程学习 > C#/ASP.NET >>

使用system.windows.form.ribbon.dll,也就是office中的ribbon控件报错

winform c#

向界面添加一个ribbon控件,到如下步骤就报错:
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.ribbon1);
this.Name = "Form1";
this.Text = "Form1";

add时报错。
错误代码:
System.ComponentModel.Win32Exception was unhandled
  HResult=-2147467259
  Message=操作成功完成。
  Source=System.Windows.Forms.Ribbon35
  ErrorCode=-2147467259
  NativeErrorCode=0
  StackTrace:
       at System.Windows.Forms.RibbonHelpers.GlobalHook.InstallHook()
       at System.Windows.Forms.RibbonHelpers.GlobalHook..ctor(HookTypes hookType)
       at System.Windows.Forms.Ribbon.SetUpHooks()
       at System.Windows.Forms.Ribbon.OnParentChanged(EventArgs e)
       at System.Windows.Forms.Control.AssignParent(Control value)
       at System.Windows.Forms.Control.ControlCollection.Add(Control value)
       at System.Windows.Forms.Form.ControlCollection.Add(Control value)
       at WindowsFormsApplication16.Form1.InitializeComponent() in d:\Demo\WindowsFormsApplication16\WindowsFormsApplication16\Form1.Designer.cs:line 98
       at WindowsFormsApplication16.Form1..ctor() in d:\Demo\WindowsFormsApplication16\WindowsFormsApplication16\Form1.cs:line 17
       at WindowsFormsApplication16.Program.Main() in d:\Demo\WindowsFormsApplication16\WindowsFormsApplication16\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

各位大神帮帮忙 ribbon winform c#
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,