New Ribbon: How to control layout when Ribbon size changes?

Posted by: peiffer on 8 July 2020, 10:49 am EST

    • Post Options:
    • Link

    Posted 8 July 2020, 10:49 am EST

    The new Ribbon adjusts the size of its elements quite well when there is not enough space for all elements in their full size (e.g. using the LargeImage).

    I am looking for a how-to or other documentation on how one can fine-tune the behavior.

    Example:

    A button renders with large image + text. When size must be reduced, switch to small image but also remove the text.

    (What happens now is that the text might be shown next to the small icon and thus even more space is used)

  • Posted 9 July 2020, 5:39 am EST

    Hi Frank,

    I hope by changing the ribbon’s size, you mean changing the ViewMode of the Ribbon.

    This is the default behavior of the control.

    If you want to remove the text in the Simplified mode then you have to handle it manually as given below:

    string text = "";
    private void C1Ribbon1_ViewChanged(object sender, EventArgs e)
       {
           if(c1Ribbon1.ViewMode == ViewMode.Simplified)
             {
                text = ribbonItem.Text;
                ribbonItem.Text = "";
             }
            else
              {
                  ribbonItem.Text = text;
              }
        }
    

    If you meant something else then please let us know.

    Regards,

    Prabhat Sharma.

  • Posted 13 July 2020, 10:24 am EST

    Hi Prabhat,

    thanks for your answer and sorry for being not clear.

    What I meant is the size change of the application window (when using the non-Simplified ribbon mode). With insufficient horizontal space not all ribbon elements can be rendered with their large images. The ribbon then switches some elements to use the smaller images.

    We found some rules how to control the behavior like “do not set SmallImage to avoid button x to switch to a smaller image”. But this is based on our observations.

    Can you point me to some guide or documentation explaining these rules?

  • Posted 14 July 2020, 3:46 am EST

    Hi Frank,

    We found some rules on how to control the behavior.

    It is good to hear that the issue has been resolved at your end. If you are facing any other issue then please let us know.

    Can you point me to some guide or documentation explaining these rules?

    There is no specific link which explains the same but you can go through the following link which demonstraters how Icons can be displayed in C1Ribbon:

    https://www.grapecity.com/componentone/docs/win/online-ribbon/icon.html

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels