Adding RadProgressBar (or RadWaitingBar) to a StatusStrip
Article Info
Rating: Not rated
|
Article relates to
|
RadProgressBar, RadWaitingBar for WinForms
|
|
Created by
|
Nikolay Diyanov, Telerik
|
|
Last modified
|
October 22, 2007
|
|
Last modified by
|
Nikolay Diyanov, Telerik
|
HOW-TO
Put a
RadProgressBar or a
RadWaitingBar in a
StatusStrip and align it.
SOLUTION
To achieve this, follow these steps:
- Create a new instance of the RadProgressBar (RadWaitingBar) via drag and drop from the toolbox or create it programmatically.
- In the form's constructor after the InitializeComponent method call or in the form Load event handler use the code snippet below:
ToolStripControlHost host = new ToolStripControlHost(this.radProgressBar1);
this.statusStrip1.Items.Add(host);
- Let's say you want to align the RadProgressBar (RadWaitingBar) to the right in the StatusStrip:
host.Alignment = ToolStripItemAlignment.Right;
statusStrip1.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow ;
- Finally, to prevent the StatusStrip from stretching and shrinking everytime the RadProgressBar (RadWaitingBar) is shown or hidden, add this line:
statusStrip1.AutoSize = false;
Comments
There are no comments yet.
If you'd like to comment on this KB
article, please, send us a
Support Ticket.
Thank you!
Please
Sign In
to rate this article.