RadStatusStrip Problem

4 posts, 0 answers
  1. John
    John avatar
    15 posts
    Member since:
    Nov 2013

    Posted 02 Dec 2013 Link to this post

    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.
  2. Dimitar
    Admin
    Dimitar avatar
    1586 posts

    Posted 05 Dec 2013 Link to this post

    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 >>
  3. John
    John avatar
    15 posts
    Member since:
    Nov 2013

    Posted 05 Dec 2013 Link to this post

    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.
  4. Dimitar
    Admin
    Dimitar avatar
    1586 posts

    Posted 10 Dec 2013 Link to this post

    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 >>
Back to Top