This is a migrated thread and some comments may be shown as answers.

RadStatusStrip Problem

3 Answers 73 Views
StatusStrip
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 02 Dec 2013, 10:03 PM
Hello Support Team!
1. How may I change back color?
2. How may I change border color?
3. How may I change the grip image
4. How may I set location of items which I add on StatusStrip?
5. How may I locate my item to very last part of the right side of status strip? (without setting RightToLeft to yes) I need to have time at the right side of status strip, exactly like windows desktop.
Thanks.

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 05 Dec 2013, 03:56 PM
Hi John,

The easiest way to change the BackColor, BorderColor and the grip image is to use the Element hierarchy editor. To open the editor just click on the smart tag and press edit UI elements (see the first attached screenshot). Then you can change any properties you want, for example in the second screenshot I have changed the BackColor of the RadStatusStrip.

To reorder the added elements you can use the RadItem Collection Editor. There you can add remove or reorder the items in any way you want (see third attached picture).

Also to achieve the desired taskbar look you can set the last item Margin property. You can do that dynamically in the forms resize event handler for example:
void Form1_Resize(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, 0, 0, 0);
    }
}

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
John
Top achievements
Rank 1
answered on 05 Dec 2013, 05:47 PM
Thanks for answer.
But I don't want to use hierarchy.
I need to use codes only.
Would you please let me know the codes for those 5 items I said in my previous post?
Thanks.
0
Dimitar
Telerik team
answered on 10 Dec 2013, 02:12 PM
Hi John,

Thank you for writing back.

You can change the BackColor, BorderColor and the grip image in code like this:
((FillPrimitive)radStatusStrip1.StatusBarElement.Children[1]).BackColor = Color.Red;
((FillPrimitive)radStatusStrip1.StatusBarElement.Children[1]).NumberOfColors = 1;
 
((BorderPrimitive)radStatusStrip1.StatusBarElement.Children[0]).ForeColor = Color.Blue;
 
((ImagePrimitive)radStatusStrip1.StatusBarElement.Children[4].Children[0]).Image = Resources.the_music_icon;

As to the Items position at hand, currently you can change that by changing the LayoutStyle property:
radStatusStrip1.LayoutStyle = Telerik.WinControls.UI.RadStatusBarLayoutStyle.Overflow;

Or by setting margin and padding of the elements that are contained in the RadStatusStrip.

I hope this will be useful. Should you have further questions, I would be glad to help.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
StatusStrip
Asked by
John
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
John
Top achievements
Rank 1
Share this question
or