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

border on RadLabel

2 Answers 368 Views
Label
This is a migrated thread and some comments may be shown as answers.
Elliott
Top achievements
Rank 2
Elliott asked on 30 Aug 2012, 06:50 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 03 Sep 2012, 02:03 PM
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 >>
0
Elliott
Top achievements
Rank 2
answered on 04 Sep 2012, 01:08 PM
thanks
Tags
Label
Asked by
Elliott
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Elliott
Top achievements
Rank 2
Share this question
or