边框内有用户控件(按钮)。当鼠标离开边框时,边框慢慢地最小化,然后按钮。然后按钮的内容按字母顺序丢失。
例如: 一般信息, 一般信息, 一般信息, 一般信息, 一般信息, 一般信息, 一般信息,一般信息,一般情况, I 将军,将军等.. 但是我想显示像tihs这样的内容
一般 信息 然后迷路了。
<UserControl x:Class="HID_okworkbench.readerButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:HID_okworkbench="clr-namespace:HID_okworkbench"
x:Name="readerButtonControl" FontFamily="Tahoma" FontSize="11"
Height="auto" Width="auto">
<Grid>
<Button Name="omniButton" Height="75" VerticalAlignment="Center"
Style="{DynamicResource MyBottomLeftButtonStyle}"
Background="White"
HorizontalContentAlignment="Left" BorderThickness="0">
<DockPanel Name="dockPanelOmni" Margin="0,0,0,0">
<Image Name="omniButtonImage" DockPanel.Dock="Left" Height="35" Width="35"
Stretch="Uniform" />
<Label Name="omniButtonLabel" DockPanel.Dock="Right" Foreground="DarkBlue" VerticalAlignment="Center">
</Label>
</DockPanel>
</Button>
</Grid>
最佳答案
不知道您在说什么,但请尝试将 Width="Auto"添加到所有内容,包括将托管相关 readerButtonControl 实例的控件。
如果这没有帮助,请添加一些屏幕截图和包含 readerButtonControl 实例的 xaml。
关于c# - 调整边框大小的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7499150/