让WPF RadioButton显示为子弹

时间:2015-07-13 14:24:08

标签: .net wpf vb.net

这个让我疯了。如何将WPF RadioButton显示为子弹(代码隐藏)

使用.Content我可以将它作为图像或文本框(如果选中则突出显示)。试图获得带有一些文本的标准单选按钮

这适用于图像

 Dim SortIDUpRB As New RadioButton
            With SortIDUpRB
                .GroupName = "IDRB"
                .Name = "Prospects_SortIDUpRB"
                .ToolTip = "Sort records in descending order"
                .Content = ReturnToolBarImage("Arrow_Up.png")
            End With
            RegisterControl(Prospects_Grid, SortIDUpRB)
            SortToolBar.Items.Add(SortIDUpRB)

            Dim SortIDDown As New RadioButton
            With SortIDDown
                .GroupName = "IDRB"
                .Name = "Prospects_SortIDDownRB"
                .ToolTip = "Sort records in ascending order"
                .Content = ReturnToolBarImage("Arrow_Down.png")
                .IsChecked = True
            End With
            RegisterControl(Prospects_Grid, SortIDDown)
            SortToolBar.Items.Add(SortIDDown)
            SortToolBar.Items.Add(TS_Separator)

...但我可以将其作为标准子弹显示吗???

由于

1 个答案:

答案 0 :(得分:0)

我想通了 - 希望它可以帮助其他人

            Dim SortIDCB As New RadioButton
            With SortIDCB
                .Width = 16
                .Height = 16
                .Margin = New Thickness(2.5, 0, -2.5, 0)
                .Content = SortIDString
                .ToolTip = "Sort by ID"
                .Name = "Prospects_SortIDCB"
            End With
            RegisterControl(Prospects_Grid, SortIDCB)
            'SortToolBar.Items.Add(SortIDCB)

            Dim BC As New System.Windows.Controls.Primitives.BulletDecorator
            With BC
                .Child = SortIDCB
            End With
            SortToolBar.Items.Add(BC)