Rounded Selection

3 posts, 0 answers
  1. Andre
    Andre avatar
    30 posts
    Member since:
    Dec 2012

    Posted 23 Jan 2013 Link to this post

    How would i add rounded corners to the highlighted item similar to "recent projects" in the visual studio start page?

    http://www.telerik.com/community/forums/winforms/dropdownlist-and-listcontrol/dropdownlist-shape-roundrect-c.aspx

    I've read the following post, but i can't seem to figure out how to change the selection, rather than the control

    Thanks
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 28 Jan 2013 Link to this post

    Hello Andre,

    Thank you for contacting us.

    You can use the VisualItemFormatting event to apply shape to all visual items. The following code sample demonstrates this:
    public Form1()
    {
        InitializeComponent();
     
        this.radListControl1.VisualItemFormatting += new Telerik.WinControls.UI.VisualListItemFormattingEventHandler(radListControl1_VisualItemFormatting);
     
        for (int i = 0; i < 30; i++)
        {
            this.radListControl1.Items.Add("Item " + i);
        }
    }
     
    void radListControl1_VisualItemFormatting(object sender, Telerik.WinControls.UI.VisualItemFormattingEventArgs args)
    {
        args.VisualItem.Shape = new RoundRectShape(3);
    }

    Hope you find this useful. If you have any other questions, do not hesitate to ask.

    Greetings,
    Ivan Todorov
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Andre
    Andre avatar
    30 posts
    Member since:
    Dec 2012

    Posted 28 Jan 2013 Link to this post

    This is great, thanks for your help.
Back to Top