WPF Invisible CheckBox

时间:2013-06-24 02:02:53

标签: wpf vb.net checkbox

放置在工具栏中的复选框不可见(.NET 4.0 Win 7.0 Aero)

        Dim vLabel As New Label
        vLabel.Content = "Tenant"

        Dim TenantDP As New DockPanel
        Dim TenantCB As New CheckBox
        With TenantCB
            .Content = vLabel
            .Name = "WebsiteUser_TenantCB"
            .ToolTip = "Check if the user is a tenant"
            .VerticalAlignment = Windows.VerticalAlignment.Center
            .HorizontalAlignment = Windows.HorizontalAlignment.Left
            .Padding = New Thickness(5, 0, 0, 0)
            .BorderBrush = New SolidColorBrush(Colors.Black)
            .IsEnabled = True
        End With

        RegisterControl(Website_User_Grid, TenantCB, TenantCB.Name.ToString)
        TenantDP.Children.Add(TenantCB)
        vToolBar.Items.Add(TenantDP)
        vToolBar.Items.Add(TS_Separator)

我可以使用Border,

显示框(直到鼠标移过它)
            .BorderBrush = New SolidColorBrush(Colors.Black)

但不是检查 - 实际控件工作正常,但用户根本看不到它。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

原来这是主题的问题!