Completed
Last Updated: 31 May 2019 11:57 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 14 Jul 2014 10:51
Category: RibbonBar
Type: Bug Report
0
FIX. RadRibbonBar - Buttons with images are not rendered correctly when the form is maximized
To reproduce:
1. Add a RadRibbonBar and add several buttons with images as follows:

public Form1()
{
    InitializeComponent();

    RibbonTab tabItem1 = new RibbonTab();
    tabItem1.Text = "Manage";
    radRibbonBar1.CommandTabs.Add(tabItem1);

    RadRibbonBarGroup radRibbonBarGroup1 = new RadRibbonBarGroup();
    radRibbonBarGroup1.Text = "radRibbonBarGroup1";
    tabItem1.Items.Add(radRibbonBarGroup1);

    RadButtonElement radButtonElement1 = new RadButtonElement();
    radButtonElement1.Image = Properties.Resources.about;
    radButtonElement1.TextImageRelation = TextImageRelation.ImageBeforeText;
    radButtonElement1.Text = "First Button";
    radRibbonBarGroup1.Items.Add(radButtonElement1);

    RadButtonElement radButtonElement2 = new RadButtonElement();
    radButtonElement2.Image = Properties.Resources.about;
    radButtonElement2.TextImageRelation = TextImageRelation.ImageBeforeText;
    radButtonElement2.Text = "Second Button";
    radRibbonBarGroup1.Items.AddRange(new RadItem[] { radButtonElement1, radButtonElement2 });

    RadRibbonBarButtonGroup radRibbonBarButtonGroup1 = new RadRibbonBarButtonGroup();
    radRibbonBarButtonGroup1.Orientation = System.Windows.Forms.Orientation.Vertical;
    radRibbonBarButtonGroup1.ShowBorder = true;

    RadButtonElement radButtonElement3 = new RadButtonElement();
    radButtonElement3.Text = "Button One";
    radButtonElement3.Image = Properties.Resources.about;
    radButtonElement3.TextImageRelation = TextImageRelation.ImageBeforeText;

    RadButtonElement radButtonElement4 = new RadButtonElement();
    radButtonElement4.Text = "Button Two";
    radButtonElement4.Image = Properties.Resources.about;
    radButtonElement4.TextImageRelation = TextImageRelation.ImageBeforeText;
  
    radRibbonBarButtonGroup1.Items.AddRange(new RadItem[] { radButtonElement3, radButtonElement4 });
    radRibbonBarGroup1.Items.Add(radRibbonBarButtonGroup1);
}

2. Run the applications, re-size the form horizontally until all buttons are collapsed to smallest size, then click the form's maximize button. As a result all buttons are drawn without text.

Workaround:
protected override void WndProc(ref Message message)
{
    const int WM_SYSCOMMAND = 0x0112;
    const int SC_MAXIMIZE = 0xF030; 

    switch (message.Msg)
    {
        case WM_SYSCOMMAND:
            int command = message.WParam.ToInt32() & 0xfff0;
            if (command == SC_MAXIMIZE) 
            {
                this.Size = new System.Drawing.Size(300, 300);
            }
            break;
    }
    base.WndProc(ref message);
}
2 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 31 May 2019 11:57
Hello, Mihajlo,     

Indeed, the provided screenshots illustrates weird behavior. After further investigation I was able to replicate the problem with RadRibbonBar. I have logged it in our feedback portal by creating a public thread on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Mihajlo
Posted on: 29 May 2019 10:13
In R2 2019 some buttons are still drawn without text after the window is maximized from totally collapsed ribbon bar groups. For instance in Demo app in Home tab clipboard buttons and Editing & Proofing buttons have no text after the window is maximized. And also Styles group is not even expanded.