【问题标题】:how do i remove space from richTextBox我如何从richTextBox中删除空间
【发布时间】:2023-03-15 18:37:01
【问题描述】:

http://i.imgur.com/dGeFu.png

如何删除空间?这有什么财产吗?或者我只能在 xaml 中手动完成?这是所有 xaml:

<Window x:Class="WPFnotatnik.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <Menu Grid.Row="0">
        <MenuItem Header="File"/>
        <MenuItem Header="Another"/>
    </Menu>
    <Grid x:Name="contentGrid" Grid.Row="1">
        <RichTextBox Name="richTextBox1" HorizontalContentAlignment="Left" />
    </Grid>
</Grid>

【问题讨论】:

标签: c# wpf visual-studio xaml


【解决方案1】:

这是有效的:Padding="-4 0 0 0"

<RichTextBox Name="richTextBox1"
                     HorizontalContentAlignment="Left"
                     Padding="-4 0 0 0" />

【讨论】:

    【解决方案2】:

    您是否尝试过设置Margin=0Padding = 0?这可能会奏效:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-12
      • 1970-01-01
      • 2019-12-10
      • 1970-01-01
      • 2019-05-18
      • 1970-01-01
      • 2023-04-05
      • 1970-01-01
      相关资源
      最近更新 更多