开发者

Is there any way to apply shader effect on particular cell of a Grid

Is there any way to apply shader effect on particular cell of a开发者_如何学编程 Grid.

BR


You cannot apply a shader effect on a particular Grid cell, but you can add a Rectangle or Border control within a panel (like Grid) to get the desired effect you are looking for. Remember to add the Rectangle first, or play with ZIndex as I show below so that your code does not hide any controls.

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Rectangle Grid.Column="0" Grid.Row="1" Panel.ZIndex="0" >
            <Rectangle.Style>
                <Style TargetType="{x:Type Rectangle}">
                    <Setter Property="Fill" Value="Blue"/>
                </Style>
            </Rectangle.Style>
        </Rectangle >
        <TextBox Grid.Column="0" Grid.Row="1" Height="25" Margin="10" Text="Test 123" Panel.ZIndex="1" />
    </Grid>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜