Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How I can add seperator between two buttons on toolbar

How I can add seperator between two buttons on toolbar

Scheduled Pinned Locked Moved C#
help
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amitrajput284
    wrote on last edited by
    #1

    Hi All, I want to add seperator on toolbar. I am using the following code to add button. HelpButton = (CommandBarButton)oStandardBar.Controls.Add(1, missing, missing, missing, missing); //firstButton.Style = MsoButtonStyle.msoButtonCaption; HelpButton.TooltipText = "Help"; HelpButton.Tag = "btnHelp"; HelpButton.Click += new _CommandBarButtonEvents_ClickEventHandler(ButtonClick); AddImage(ref HelpButton, "Help"); Please suggest how I can add seperator between two buttons on toolbar. Thanks in advance.

    asd

    R S 2 Replies Last reply
    0
    • A amitrajput284

      Hi All, I want to add seperator on toolbar. I am using the following code to add button. HelpButton = (CommandBarButton)oStandardBar.Controls.Add(1, missing, missing, missing, missing); //firstButton.Style = MsoButtonStyle.msoButtonCaption; HelpButton.TooltipText = "Help"; HelpButton.Tag = "btnHelp"; HelpButton.Click += new _CommandBarButtonEvents_ClickEventHandler(ButtonClick); AddImage(ref HelpButton, "Help"); Please suggest how I can add seperator between two buttons on toolbar. Thanks in advance.

      asd

      R Offline
      R Offline
      Rick van Woudenberg
      wrote on last edited by
      #2

      Hi, Add a new button to your toolbar. Change its name to , ( eg. tbbSeparator1 ) and change its Style to Separator. When you change the Style property of the button to Separator, it disappears from the toolbar, or at least it seems to. When a button is designated as a separator, it's simply an empty placeholder used to create a space between two buttons. Because this separator is at the end row of buttons, you can't see it. Move it to the second position by selecting it in the ToolBarButton Collection Editor and clicking the up arrow that appears to the right of the Members list; this arrow and the one below it are used to move a button up or down in the list. Click OK to save your changes and your toolbar will now have a space between the two buttons. Have fun! Regards,

      A 1 Reply Last reply
      0
      • R Rick van Woudenberg

        Hi, Add a new button to your toolbar. Change its name to , ( eg. tbbSeparator1 ) and change its Style to Separator. When you change the Style property of the button to Separator, it disappears from the toolbar, or at least it seems to. When a button is designated as a separator, it's simply an empty placeholder used to create a space between two buttons. Because this separator is at the end row of buttons, you can't see it. Move it to the second position by selecting it in the ToolBarButton Collection Editor and clicking the up arrow that appears to the right of the Members list; this arrow and the one below it are used to move a button up or down in the list. Click OK to save your changes and your toolbar will now have a space between the two buttons. Have fun! Regards,

        A Offline
        A Offline
        amitrajput284
        wrote on last edited by
        #3

        Thanks for the reply. But I am creating the add inn application and creating the command bar through the code (C#). For button style i am using customButton.Style = MsoButtonStyle.msoButtonIconAndCaption; and no seperator kind of style available for MsoButtonStyle Thanks.

        asd

        A 1 Reply Last reply
        0
        • A amitrajput284

          Hi All, I want to add seperator on toolbar. I am using the following code to add button. HelpButton = (CommandBarButton)oStandardBar.Controls.Add(1, missing, missing, missing, missing); //firstButton.Style = MsoButtonStyle.msoButtonCaption; HelpButton.TooltipText = "Help"; HelpButton.Tag = "btnHelp"; HelpButton.Click += new _CommandBarButtonEvents_ClickEventHandler(ButtonClick); AddImage(ref HelpButton, "Help"); Please suggest how I can add seperator between two buttons on toolbar. Thanks in advance.

          asd

          S Offline
          S Offline
          ShermansLagoon
          wrote on last edited by
          #4

          An easy way of seeing how to do things like this is to create a dummy-project, set it up as you like to have it by using the graphical editor, and then look at the code.

          Internet - the worlds biggest dictionary

          1 Reply Last reply
          0
          • A amitrajput284

            Thanks for the reply. But I am creating the add inn application and creating the command bar through the code (C#). For button style i am using customButton.Style = MsoButtonStyle.msoButtonIconAndCaption; and no seperator kind of style available for MsoButtonStyle Thanks.

            asd

            A Offline
            A Offline
            Abisodun
            wrote on last edited by
            #5

            Use customButton.BeginGroup = true; for the second button.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups