Hi,
Is it possible to place the progressbar inside the statusstrip to the right hand side? Seems all the controls at the bottom are placed from left to right. But I would like to have some on the right, and some on the left.
Thanks,
Carlitos
4 Answers, 1 is accepted
Thank you for writing.
This can be achieved by dynamically setting the Margin of the progress bar when the form is resized. For example:
private void RadForm1_SizeChanged(object sender, EventArgs e){ int totalWidth = radStatusStrip1.Width; int elementsWidth = 0; foreach (RadItem item in radStatusStrip1.Items) { elementsWidth += item.Size.Width; } int emptySpace = totalWidth - elementsWidth; if (emptySpace > 0) { radStatusStrip1.Items[radStatusStrip1.Items.Count - 1].Margin = new System.Windows.Forms.Padding(emptySpace-25, 0, 0, 0);// 25 pixels for the size grip }}Please let me know if there is something else I can help you with.
Dimitar
Telerik by Progress
It appears that there is an easier way to achieve this. First, you need to add a label with no text before the progress bar. Then you should set the Spring property of the label to true. I have attached an image that shows this approach.
I hope this will be useful.
Regards,
Dimitar
Telerik by Progress
Thanks Dimitar for both methods. Your second solution think works the easiest. I found another solution similar to your first one.
It was this:
private void RadFormMainSystem_SizeChanged(object sender, EventArgs e)
{
var newProgressBarSize = new Size(0, 18);
var newWidth = radStatusStripSystem.Width - 600;
newProgressBarSize.Width = newWidth >= 250 ? newWidth : 250;
radReportProgressBar.Size = newProgressBarSize;
}
But I will stick with your second solution (as there is no coding to maintain).
Thanks!
Carlitos
I am glad I could be of help. Let us know if you have any other questions.
Regards,
Dimitar
Telerik by Progress
