<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: RibbonButton like the Insert dropdown of buttons in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10640412#M15195</link>
    <description>&lt;P&gt;How do I add items to the menu?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 17:28:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-22T17:28:08Z</dc:date>
    <item>
      <title>RibbonButton like the Insert dropdown of buttons</title>
      <link>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10626816#M15193</link>
      <description>&lt;P&gt;I am trying to make a dropdown of buttons like the Insert button. Does anyone know type of button that is?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 12:32:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10626816#M15193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-16T12:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: RibbonButton like the Insert dropdown of buttons</title>
      <link>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10627100#M15194</link>
      <description>&lt;P&gt;You can use this as extension method (and your own method to load your icon):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static RibbonMenuButton AddMenuButton(this RibbonRowPanel rowPanel, string buttonId, string buttonText, string iconName)
{
	RibbonMenuButton menuButton = new RibbonMenuButton();
	menuButton.Text = buttonText;
	menuButton.Orientation = System.Windows.Controls.Orientation.Horizontal;
	menuButton.Size = RibbonItemSize.Standard;
	menuButton.ShowText = true;
	menuButton.LargeImage = LoadImage(iconName, 32, 32);
	menuButton.Image = LoadImage(iconName, 16, 16);
	menuButton.ShowImage = true;
	menuButton.ListButtonStyle = Autodesk.Private.Windows.RibbonListButtonStyle.MenuButton;
	menuButton.Id = buttonId;
	rowPanel.Items.Add(menuButton);
	rowPanel.Items.Add(new RibbonRowBreak());
	return menuButton;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 14:51:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10627100#M15194</guid>
      <dc:creator>gleeuwdrent</dc:creator>
      <dc:date>2021-09-16T14:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: RibbonButton like the Insert dropdown of buttons</title>
      <link>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10640412#M15195</link>
      <description>&lt;P&gt;How do I add items to the menu?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 17:28:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10640412#M15195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-22T17:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: RibbonButton like the Insert dropdown of buttons</title>
      <link>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10641432#M15196</link>
      <description>&lt;P&gt;I use this extension:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static void AddButtonToDropDown(this RibbonMenuButton menuButton, string buttonId, string buttonText, string description, string iconName, string command)
{
	RibbonMenuItem button = new RibbonMenuItem();
	button.Text = buttonText;
	button.ShowText = true;
	button.ShowImage = true;
	button.LargeImage = LoadImage(iconName,, 32, 32);
	button.Image = LoadImage(iconName, 16, 16);
	button.Id = buttonId;
	button.CommandParameter = command;
	button.Description = description;
	button.CommandHandler = new AdskCommandHandler();
	menuButton.Items.Add(button);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this CommandHandler:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class AdskCommandHandler : System.Windows.Input.ICommand
{
	public bool CanExecute(object parameter)
	{
		return true;
	}
	public event EventHandler CanExecuteChanged;
	public void Execute(object parameter)
	{
		var ribbonItem = parameter as RibbonCommandItem;
		if (ribbonItem != null)
		{
			Autodesk.AutoCAD.ApplicationServices.Document doc = AcAp.DocumentManager.MdiActiveDocument;
			//Make sure the command text either ends with ";", or a " "
			string cmdText = ((string)ribbonItem.CommandParameter).Trim();
			if (!cmdText.EndsWith(";")) cmdText = cmdText + " ";
			doc.SendStringToExecute(cmdText, true, false, true);
		}
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 05:31:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/ribbonbutton-like-the-insert-dropdown-of-buttons/m-p/10641432#M15196</guid>
      <dc:creator>gleeuwdrent</dc:creator>
      <dc:date>2021-09-23T05:31:03Z</dc:date>
    </item>
  </channel>
</rss>

