小编gil*_*nan的帖子

检查所有行的列中的值是否正好是值

例如,我想要将数字2作为目标

这应该返回积极的迹象:

ID       Status
123      2
432      2
531      2
123      2
Run Code Online (Sandbox Code Playgroud)

这应该返回负面指示:

ID       Status
123      1
432      3
531      2
123      2
Run Code Online (Sandbox Code Playgroud)

这应该返回负面指示:

ID       Status
123      1
432      1
531      1
123      1
Run Code Online (Sandbox Code Playgroud)

谢谢

sql

8
推荐指数
3
解决办法
3万
查看次数

ListBox和DataTrigger

为什么不工作?

XAML:

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="218" Width="239">
    <Grid>
        <ListBox Margin="12" Name="listBox1">
            <Style TargetType="{x:Type ListBoxItem}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=Name}" Value="Gil">
                        <Setter Property="ListBoxItem.Background"  Value="Red" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ListBox>
    </Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)

代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WpfApplication1
{
    public class User
    {
        private string name;
        private string role;

        public User(string strName, string strRole)
        {
            Name = strName;
            Role = strRole;
        }

        public string Name
        {
            get { return name; }
            set { name = value; …
Run Code Online (Sandbox Code Playgroud)

c# wpf listbox

4
推荐指数
1
解决办法
5805
查看次数

标签 统计

c# ×1

listbox ×1

sql ×1

wpf ×1