小编Kūr*_*osh的帖子

WPF中的圆角文本框

我在网上搜索带圆角的TextBox,并找到如下的xaml代码:

 <Style TargetType="{x:Type my1:CustomTextBox}">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate >
                        <Border Background="{TemplateBinding Background}" x:Name="Bd" 
BorderThickness="2" CornerRadius="5" BorderBrush="#FFF9EAB6">
                            ***<ScrollViewer x:Name="PART_ContentHost" />***
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#FFC7B0B0"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#FFC7B0B0"/>
                                <Setter Property="Foreground" Value="Black"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="False">
                                <Setter Property="Foreground" Value="#FFC7B0B0"/>
                            </Trigger>
                            <Trigger Property="Width" Value="Auto">
                                <Setter Property="MinWidth" Value="120"/>
                            </Trigger>
                            <Trigger Property="Height" Value="Auto">
                                <Setter Property="MinHeight" Value="27"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>

                </Setter.Value>
            </Setter>
        </Style>
Run Code Online (Sandbox Code Playgroud)

我想知道是什么

<ScrollViewer x:Name="PART_ContentHost" />
Run Code Online (Sandbox Code Playgroud)

详细说明为什么不正确地工作我的模板如果从中删除这一行,请详细告诉我.

非常感谢.

c# wpf

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

如何使用键绑定将文本框聚焦在xaml中?

如何TextBoxF3按下按键时设置焦点.

换句话说,做一些像下面这样的事情:

private void Window_PreviewKeyDown(object sender, KeyEventArgs )
{
       switch (e.Key)
       {
           case Key.F3:
               myTextBox1.Focus();
               break;
           case Key.F4:
               myTextBox2.Focus();
               break;
           default:
               break;
      }
}
Run Code Online (Sandbox Code Playgroud)

注意:我想在xaml中完成.

c# wpf textbox keypress

2
推荐指数
1
解决办法
1234
查看次数

使用变量将byte []传递给stimulsoft以在图像上显示

我想将我byte arraysql数据库(varbinary)获取的徽标传递给我的stimulsoft报告,使用变量并在标题中的图像组件中显示.

任何人都可以帮忙吗?

c# wpf stimulsoft

2
推荐指数
1
解决办法
2179
查看次数

标签 统计

c# ×3

wpf ×3

keypress ×1

stimulsoft ×1

textbox ×1