Dimitar Karamfilov
Team Member

FIX. RadDropDownButton - when the AutoSize property is set to true and the button is anchored to top, right the button is resized to the right.

To reproduce:
- Add RadDropDownButton to a blank form.
- Set its anchor property to top, right and its AutoSize property to true.
- At runtime set the button text to a long string, you will notice that the button is resized to the right when it should be resized to the left.

To workaround this you can subscribe to the SizeChanged event of the button change its location depending on the new size:
Size prevSize;

public Form1()
{
InitializeComponent();
radDropDownButton1.AutoSize = true;

this.Shown += Form1_Shown;
}

void Form1_Shown(object sender, EventArgs e)
{
prevSize = radDropDownButton1.Size;

radDropDownButton1.SizeChanged += radDropDownButton1_SizeChanged;
}

void radDropDownButton1_SizeChanged(object sender, EventArgs e)
{
RadDropDownButton button = sender as RadDropDownButton;
button.Location = new Point(button.Location.X - (radDropDownButton1.Size.Width - prevSize.Width), button.Location.Y);
prevSize = button.Size;

}

private void radButton2_Click(object sender, EventArgs e)
{
radDropDownButton1.Text = "Very long button text set";
}
Bug Report by Dimitar Karamfilov Status: In Development Comments: 0 Category: Drop-down and split buttons Scheduled for: Not Scheduled Last update: 2015-04-07T16:46:17 by Stefan Stefanov
0
Displaying items 1221 - 1221 of 1221