none
Adding a separator to the Expression Web 4 MenuBar and Toolbar through C# RRS feed

  • Question

  • Hi!

    I have  created an add-in for Expression Web 4 where I have a menu and a toolbar. I have created the menu and the toolbar items, the ony thing left now is to add the separators in the Menu as well as Toolbar using C#.

    Kindly help me in this regard

    Fahad Ali Shaikh


    Fahad Ali Shaikh
    Tuesday, October 12, 2010 11:51 AM

All replies

  • HI!

    Just to add something here. The EW 4 addin provides a link by default in the Toolbar and in a menu. The method for creating the Toolbar items and the menu items are pre-created in the class.

    Below is an example call 

     AddMenuItem("cWSettings", null, "Settings", "Settings", iPicSettings, "Settings", null);
            btnSettings = AddToolbarItem("Casewise_Toolbar", null, "Settings", "Settings", iPicSettings, "Settings", this.MyFileOpen);
    

     

     


    Fahad Ali Shaikh
    Wednesday, October 13, 2010 6:36 AM
  • You use the BeginGroup property for this.

    http://msdn.microsoft.com/en-us/library/aa141882(office.10).aspx

    Jim


    Jim Cheshire http://www.jimcobooks.com
    Wednesday, October 13, 2010 11:32 PM
    Moderator
  • Hi!

    Thanks Jim, well there is one more thing that I need to ask is how to add a toolbar item of a spilit button type? Like  you see a new button in the toolbar, there appears a small arrow pointing downwards and it opens as a dropdown menu displaying all the other options.

    So how can I make something like that of my own?

    Thanks and regards

    Fahad Ali Shaikh


    Fahad Ali Shaikh
    Monday, October 18, 2010 7:46 AM
  • You use the BeginGroup property for this.

    http://msdn.microsoft.com/en-us/library/aa141882(office.10).aspx

    Jim


    Jim Cheshire http://www.jimcobooks.com


    And one more thing is that I have tried this stuff but it din't work rather when I set the property BeginGroup of a toolbar button, the items preceeding it disappear.

            CommandBarButton separator = new CommandBarButton();
            separator = AddToolbarItem("Casewise_Toolbar", null, "cWSeperator", null, null, null, null);
            separator.BeginGroup = true;

    Any ideas!!!

    Thanks and regards


    Fahad Ali Shaikh
    Tuesday, October 19, 2010 5:27 AM
  • That doesn't make sense. Not sure what's happening there. One thing I do notice is that you seem to be using AddToolbarItem to add a separator bar. That's not the way it works. You use AddToolbarItem to add your button and then you set BeginGroup on that button. The BeginGroup property adds the separator. You don't do it explicitly.

    Jim

     


    Jim Cheshire http://www.jimcobooks.com
    Tuesday, October 19, 2010 10:32 AM
    Moderator
  • I don't believe this is possible. I answered in your other thread.

    Jim


    Jim Cheshire http://www.jimcobooks.com
    Tuesday, October 19, 2010 10:33 AM
    Moderator
  • That doesn't make sense. Not sure what's happening there. One thing I do notice is that you seem to be using AddToolbarItem to add a separator bar. That's not the way it works. You use AddToolbarItem to add your button and then you set BeginGroup on that button. The BeginGroup property adds the separator. You don't do it explicitly.

    Jim

     


    Jim Cheshire http://www.jimcobooks.com


    Thanks Jim,

    Well I did the same as you told but the problem persists.

    Thanks and regards.


    Fahad Ali Shaikh
    Tuesday, October 19, 2010 10:49 AM
  • I don't believe this is possible. I answered in your other thread.

    Jim


    Jim Cheshire http://www.jimcobooks.com


    Why not? This is extremely strange. If there are separation bars in EW then why not I use it for my toolbar and menu Bar?? Microsoft guys need to look into it seriously.

    regards


    Fahad Ali Shaikh
    Tuesday, October 19, 2010 10:50 AM
  • I don't believe this is possible. I answered in your other thread.

    Jim


    Jim Cheshire http://www.jimcobooks.com


    Why not? This is extremely strange. If there are separation bars in EW then why not I use it for my toolbar and menu Bar?? Microsoft guys need to look into it seriously.

    regards


    Fahad Ali Shaikh


    This is one of the reasons we discourage multiple threads on the same subject, or in this case, bringing two distinct threads into the same thread. You have managed to conflate two different topics and confuse the issue.

    What Jim is talking about in this response is your question about adding a dropdown menu to a command bar, which he has already told you in another thread can't be done. What you are confusing that with in your response is the original question of this thread, which regards menu separators.

    Jim has already told you (a) that you can do that, and (b) how to do it, above. He has also told you, both in the other thread and now here, that you cannot add a dropdown to a command bar. Got it?

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    Tuesday, October 19, 2010 2:32 PM

  • I don't believe this is possible. I answered in your other thread.

    Jim


    Jim Cheshire http://www.jimcobooks.com


    Why not? This is extremely strange. If there are separation bars in EW then why not I use it for my toolbar and menu Bar?? Microsoft guys need to look into it seriously.

    regards


    Fahad Ali Shaikh


    This is one of the reasons we discourage multiple threads on the same subject, or in this case, bringing two distinct threads into the same thread. You have managed to conflate two different topics and confuse the issue.

    What Jim is talking about in this response is your question about adding a dropdown menu to a command bar, which he has already told you in another thread can't be done. What you are confusing that with in your response is the original question of this thread, which regards menu separators.

    Jim has already told you (a) that you can do that, and (b) how to do it, above. He has also told you, both in the other thread and now here, that you cannot add a dropdown to a command bar. Got it?

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    Well thanks for the tip.

    I dont personally believe it is not possible. Why cant remake a simple add-in just like the one already comes with EW?

    Secondly regarding the separation bars, I already had told that it's not working. So the question is not whether it is possible or not but the question is how? 

     

    thanks and regards

    Fahad Ali Shaikh


    Fahad Ali Shaikh
    Wednesday, October 20, 2010 9:21 AM
  • I dont personally believe it is not possible. Why cant remake a simple add-in just like the one already comes with EW?

    Secondly regarding the separation bars, I already had told that it's not working. So the question is not whether it is possible or not but the question is how?

    You might want to try the CommandBarComboBox object with a MsoControlType of msoControlSplitButtonPopup. I haven't personally tested this, but that may be the control type you are looking for.

    I've already given you information on how to add a separator bar. In my response, I recommended that you try using your own code rather than the built-in code for adding a menu item. Did you try that? The BeginGroup property works perfectly. I've used it several times in my add-ins.

    Jim

     


    Jim Cheshire http://www.jimcobooks.com
    Wednesday, October 20, 2010 11:06 AM
    Moderator