About UI

Jun 10, 2015 at 8:02 AM
I am using ribbon control, the problem is how to add a button in the header and set the icon at the same time.
Jun 10, 2015 at 4:43 PM
private SimpleActionItem newButton;
public override void Activate()
            // Initialize the Ribbon controls in the "Climate" ribbon tab
            const string HomeRootKey = "Hello";
            App.HeaderControl.Add(new RootItem(HomeRootKey, "Hello") { SortOrder = 200 });

            // Create and add a button
            newButton = new SimpleActionItem("Click Here!",buttonClick);
            newButton.RootKey = HomeRootKey;
           //This sets the icon of your button from your resources folder
            newButton.LargeImage = Resource.worldicon;
            newButton.ToggleGroupKey = "";
This code will add a button named "Click Here!" to a tab named "Hello" and set the icon for the button to be what is in your resources folder named "wordlicon." Is this what you were looking for? There is more than just copying the code into your program but this is the basic code to add a button.
Marked as answer by jany_ on 7/8/2015 at 10:42 PM
Jun 11, 2015 at 2:00 AM
yes,it is.Thank you!