border on RadLabel

3 posts, 1 answers
  1. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 30 Aug 2012 Link to this post

    how do I add a border to selected RadLabels?
    I am skinning the entire Winforms app with Desert
    the following routine only seems to expand the size of the label
    Public Sub BorderStyleLabel(ByRef rdLabel As RadLabel)
        Dim labelBorder As BorderPrimitive
        labelBorder = DirectCast(rdLabel.LabelElement.Children(1), BorderPrimitive)
        labelBorder.BoxStyle = BorderBoxStyle.SingleBorder
        labelBorder.BackColor = Color.Chocolate
        labelBorder.Width = 1
    End Sub
    I am hoping to find kode to mimic BorderStyle=FixedSingle
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 03 Sep 2012 Link to this post

    Hi Marianne,

    Thank you for writing.

    Here is the modified version of your code that will allow you to show a single border around RadLabel:
    Public Sub BorderStyleLabel(ByRef rdLabel As RadLabel)
        Dim labelBorder As BorderPrimitive = rdLabel.LabelElement.LabelBorder
        labelBorder.ForeColor = Color.Chocolate
        labelBorder.Visibility = ElementVisibility.Visible
    End Sub

    I hope this helps.
     
    Greetings,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 04 Sep 2012 Link to this post

    thanks
Back to Top