[英]WPF: Limit clickable area of checkbox to the checkbox only
我正在使用如下復選框:
<CheckBox Content="Reload Code Table Rules"
IsChecked="{Binding ReloadCodeTableRules, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center" />
當前,如果我單擊復選框或標簽,則選中狀態將更改。 是否可以將其限制為僅在選中復選框時才更改?
您可以將文本放在單獨的TextBlock
然后將它們包裝在StackPanel
:
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<CheckBox IsChecked="{Binding ReloadCodeTableRules, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
<TextBlock Margin="4,0,0,0" Text="Reload Code Table Rules" VerticalAlignment="Center"/>
</StackPanel>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.