-1
當我在wpf文本框控件中輸入spacebar (" ")
時,它從視圖中返回double spacebar
。來自輸入的WPF雙空格鍵
如何配置文本框發回原始輸入文本不與double spacebar
。
<DataTemplate x:Key="TextBoxDataTemplate">
<StackPanel Orientation="Horizontal" Background="AntiqueWhite">
<Label Name="lblTabTitle"
Content="{Binding TextForLabel}"
VerticalAlignment="Center"
Margin="4 4 2 4"
HorizontalAlignment="Left" Padding="0" />
<TextBox Name="inputText" Width="100" Margin="5" Text ="{Binding Text}" helpers:InputTextBoxBindingsManager.UpdatePropertySourceWhenKeyPressed="TextBox.Text"/>
<Button Name="btn"
Margin="2 0 0 0"
Padding="0"
Height="16"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding DataContext.DeleteItemCommand, ElementName=tagsList}"
CommandParameter="{Binding}">
<Image Name="img" Source="/Unive.Net;component/Images/GeneralIcons/16x16/quit.png" Width="16" Height="16" />
</Button>
</StackPanel>
</DataTemplate>
什麼是您當前的代碼來獲得這個問題呢? – WiiMaxx
要清楚,如果單擊一次空格鍵,會得到雙倍的空間! – Akrem
UpdatePropertySourceWhenKeyPressed怎麼樣? – Akrem