private UltraGridPrintDocument previewDocument = new UltraGridPrintDocument();
        private UltraPrintPreviewDialog previewDialog = new UltraPrintPreviewDialog();我用的是这两个控件,在打印弹出时,我想在常用工具栏中再加向个自定义的工具如何加?

解决方案 »

  1.   

    先在工程里把这个dll的引用添加进来。然后在工具里右键点一下,有个添加项目的选项,找到你要添加的控件,应该是COM控件吧,打上钩,确定。正常的话就应该有了。
      

  2.   

    C#不怎么懂,获得预览工具栏的VB.NET代码如下(先继承原类):    Public ReadOnly Property ParentToolbar() As System.Windows.Forms.ToolBar
            Get
                Dim fi As FieldInfo = GetType(System.Windows.Forms.PrintPreviewDialog).GetField("toolBar1", BindingFlags.Public Or BindingFlags.NonPublic Or BindingFlags.Instance)
                Return CType(fi.GetValue(Me), System.Windows.Forms.ToolBar)
            End Get
        End Property