I know how to set the corner radius of a button in XAML.
However, I need to set the corner radius of buttons that are created programmatically (dynamic buttons), during runtime. Here's a code example:
Dim pt As Thickness
Dim mySolidColorBrush As SolidColorBrush = New SolidColorBrush()
mySolidColorBrush = CType((New BrushConverter().ConvertFrom("#005EB8")), SolidColorBrush)
pt.Top = 95
If howMany > 0 Then
For i = 0 To howMany - 1
Buttons(i) = New Button With {
.Tag = i,
.Margin = New Thickness(5, 5, 5, 0),
.Width = 120,
.Height = 60,
.Foreground = New SolidColorBrush(Colors.White),
.Background = mySolidColorBrush,
.VerticalAlignment = VerticalAlignment.Top,
.HorizontalAlignment = HorizontalAlignment.Left,
.FontSize = 16,
.Content = btnName(i)
}
AddHandler Buttons(i).Click, AddressOf ButtonClickDyna
PNL_Main.Children.Add(Buttons(i))
pt.Top += 45
Next
End If
I was not able to find such information on the internet and have been going through the properties of a button one by one, sadly with no success.
Any help will be much appreciated as I am still a newbie.