gpt4 book ai didi

c# - 打开组合框会移动其他控件

转载 作者:太空宇宙 更新时间:2023-11-03 23:03:08 25 4
gpt4 key购买 nike

enter image description here

我定义了一个 RelativePanel,它在左侧包含一个组合框,在组合框的右侧包含一个切换开关。但出于某种原因,当单击组合框将其打开时,会弹出一个包含内容的弹出窗口,而组合框会消失。 (并通过关闭弹出窗口再次可见)。因此,包含组合框标签的文本 block 向右移动,弹出窗口与我的切换开关重叠......如何防止此文本 block 移动以防止弹出窗口与切换开关重叠? (导致此问题的是 comboImageSources,而不是其他组合框)

<RelativePanel x:Name="topBar" Grid.Row="0" Padding="12,0,12,0">

<!-- left side -->
<TextBlock x:Name="OCRSettings_Language"
Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}"
Text="OCR Language:"
Margin="0,0,12,0"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignVerticalCenterWithPanel="True" />

<ComboBox x:Uid="comboSettingsOCRLanguage" x:Name="comboOCRLanguages"
AutomationProperties.Name="[comboSettingsOCRLanguage]"
ItemsSource="{x:Bind Settings.OCRLanguages}"
ItemTemplate="{StaticResource ComboOCRLanguageTemplate}"
RelativePanel.RightOf="OCRSettings_Language"
RelativePanel.AlignVerticalCenterWithPanel="True"
Margin="0,0,12,0"
TabIndex="8"
Loaded="comboOCRLanguages_Loaded" />

<!-- right side -->
<TextBlock x:Name="OCRSettings_ImageSource"
Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}"
Text="Image Source:"
Margin="0,0,10,0"
RelativePanel.LeftOf="comboImageSources"
RelativePanel.AlignVerticalCenterWithPanel="True" />

<ComboBox x:Uid="comboImageSources" x:Name="comboImageSources"
AutomationProperties.Name="[comboImageSources]"
ItemsSource="{x:Bind Settings.ImageSources}"
ItemTemplate="{StaticResource ComboImageSourceTemplate}"
RelativePanel.LeftOf="OCRSettings_ColumnMode"
RelativePanel.AlignVerticalCenterWithPanel="True"
Margin="0,0,20,0"
TabIndex="4"
Loaded="comboImageSources_Loaded" />

最佳答案

您必须将 ComboBoxWidth 属性设置为某个固定值,因为当您打开其中的选项时它会变为非常小的值。

关于c# - 打开组合框会移动其他控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42345304/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com