5 Replies Latest reply on Jan 19, 2011 1:58 PM by nfilatov

    Adding Control to CommandBar

    nfilatov

      How to add Control to CommandBar? In PI ProcessBook VBA Language Reference written the next code:

       

      Dim cbToolbar As PBCommandBar 
      Dim cbcButton As PBCommandBarButton 
      Set cbToolbar = Application.PBCommandBars("Bar1") 
      Set cbcButton = cbToolbar.Controls.Add(pbcControlButton)
      

       But when I try to execute code like this (in C#):

      PBCommandBarScroll timeScroll;
      cb.Controls.Add(timeScroll);
      

      compiler writes that "No overload for method 'Add' takes '1' arguments" and writes tip when Add method has 5 parametres: Type, Id, Parameter, Before, Temporary. I don't know what is Before argument.

       And another question. Can I add Control with custom type (like ScrollBar, not PBCommandBarScroll) to CommandBar?

      Thanks.