Office 2010 theme and ribbons

6 posts, 2 answers
  1. tom
    tom avatar
    15 posts
    Member since:
    May 2011

    Posted 15 Aug 2011 Link to this post

    Does anybody have the same problem with the Office 2010 Blue theme?
    The position of the radRibbonBar.RibbonBarElement.ApplicationButtonElement is 2 pixels to low.
    I am not sure if this behavior was also present in Q1 2011.
    I have tried to correct it programtically by shifting the Location property, but it doesn't help.
    Is there any solution without definining a custom theme?
  2. Answer
    Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 17 Aug 2011 Link to this post

    Hello Tom,

    Thank you for your question.

    The top Margin of ApplicationButtonElement defines its offset from the top of the RadRibbonBar control. In the Office2010Blue theme it is 32 pixels. You can use the following code to move the button 2 pixels above:
    Padding currentMargin = this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.Margin;
    this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.Margin = new Padding(currentMargin.Left, 30, currentMargin.Right, currentMargin.Bottom);

    I hope it helps.

    Best regards,
    Alexander
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. tom
    tom avatar
    15 posts
    Member since:
    May 2011

    Posted 17 Aug 2011 Link to this post

    Hello Alexander,

    Great, this works fine.

    Thank you for the hotfix, but do you think this is an error in the Office 2010 theme?
    Will this be corrected with the next update?

    I am asking because, then I have to remove the manual correction.

    Regards,
    Tom

  5. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 19 Aug 2011 Link to this post

    Hello Tom,

    The issues of the Office2010 themes of RadRibbonBar you reported will be addressed in our next service pack. The manual correction will not be necessary then.

    Best regards,
    Alexander
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  6. tom
    tom avatar
    15 posts
    Member since:
    May 2011

    Posted 19 Aug 2011 Link to this post

    Hello Alexander,

    fine and thanks.

    I have also find a problem with the QuickAccessToolbar. The left position of -63px is in my opinion to far left, I have choosen the value of -60px. You can see it best, if you maximize the RadRibbonForm.

    currentMargin = this.radRibbonBar.RibbonBarElement.QuickAccessToolBar.Margin;
    this.radRibbonBar.RibbonBarElement.QuickAccessToolBar.Margin = new Padding(-60,currentMargin.Top, currentMargin.Right, currentMargin.Bottom);

    Best regards,
    Tom
  7. Answer
    Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 24 Aug 2011 Link to this post

    Hello Tom,

    Thank you for your feedback regarding RadRibbonBar themes. I will send it to our designers team.

    Your solution for changing the Margin of QuickAccessToolBar in runtime works fine if the QuickAccessToolBar is located above the rest of the RadRibbonBar elements. If your application allows the user to choose the option for showing the toolBar below the other elements, you could handle it using the RadPropertyChanged event of RibbonBarElement and its QuickAccessToolbarBelowRibbonProperty property:

    private void RibbonBarElement_RadPropertyChanged(object sender, RadPropertyChangedEventArgs e)
    {
        if (e.Property == RadRibbonBarElement.QuickAccessToolbarBelowRibbonProperty)
        {
            if (!(bool)e.NewValue)
            {
                Padding currentMargin = this.radRibbonBar1.RibbonBarElement.QuickAccessToolBar.Margin;
                this.radRibbonBar1.RibbonBarElement.QuickAccessToolBar.Margin = new Padding(-60, currentMargin.Top, currentMargin.Right, currentMargin.Bottom);
            }
            else
            {
                // use the theme defined settings or choose your own Margin
                this.radRibbonBar1.RibbonBarElement.QuickAccessToolBar.ResetValue(RadElement.MarginProperty, ValueResetFlags.Local);
            }
        }
    }

    Let me know if you have further suggestions.
     
    Best regards,
    Alexander
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
UI for WinForms is Visual Studio 2017 Ready