【发布时间】:2016-05-16 18:01:50
【问题描述】:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Rectangle Fill="#8686EA" Grid.Column="0" />
<Rectangle Fill="#FFFFE1" Grid.Column="1" />
<TextBlock x:Name="NickNameBlock" HorizontalAlignment="Left" Margin="10,22,0,0" TextWrapping="Wrap" Text="Nickname" VerticalAlignment="Top"/>
<TextBox x:Name="NickName" HorizontalAlignment="Left" Margin="84,10,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="109"/>
<TextBlock x:Name="ChannelBlock" HorizontalAlignment="Left" Margin="10,59,0,0" TextWrapping="Wrap" Text="Channel" VerticalAlignment="Top"/>
<TextBox x:Name="Channel" HorizontalAlignment="Left" Margin="84,47,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="109"/>
<Button x:Name="JoinButton" Content="Join" HorizontalAlignment="Left" Margin="198,47,0,0" VerticalAlignment="Top"/>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="630" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Rectangle Fill="white" Stroke="Black" StrokeThickness="0" Grid.Column="0" Margin="10,27,0,100" />
<!--<Rectangle Fill="white" Stroke="Black" StrokeThickness="1" Grid.Column="1" Margin="6,10,71,196" />-->
<Grid Grid.Column="1" Margin="0,0,0,196">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Rectangle Fill="#8686EA" Stroke="Black" StrokeThickness="0" Grid.Row="0" Margin="10,0,0,0" />
<Rectangle Fill="#CCCCFF" Stroke="Black" StrokeThickness="0" Grid.Row="1" Margin="10,0,0,-5" RenderTransformOrigin="0.505,0.719" Grid.RowSpan="2" />
<ListBox x:Name="listBox" Grid.Row="2" Margin="10,10,0,0" VerticalAlignment="Top" VerticalContentAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListBox.Items>
<ListBoxItem Content="Tewl"/>
<ListBoxItem Content="Ryu"/>
<ListBoxItem Content="Clint"/>
<ListBoxItem Content="Bak3r"/>
<ListBoxItem Content="sm0kex"/>
<ListBoxItem Content="Jack"/>
<ListBoxItem Content="Bam"/>
<ListBoxItem Content="Jay"/>
<ListBoxItem Content="Tewl"/>
<ListBoxItem Content="Ryu"/>
<ListBoxItem Content="Clint"/>
<ListBoxItem Content="Bak3r"/>
<ListBoxItem Content="sm0kex"/>
<ListBoxItem Content="Jack"/>
<ListBoxItem Content="Bam"/>
<ListBoxItem Content="Jay"/>
<ListBoxItem Content="Tewl"/>
<ListBoxItem Content="Ryu"/>
<ListBoxItem Content="Clint"/>
<ListBoxItem Content="Bak3r"/>
<ListBoxItem Content="sm0kex"/>
<ListBoxItem Content="Jack"/>
<ListBoxItem Content="Bam"/>
<ListBoxItem Content="Jay"/>
</ListBox.Items>
</ListBox>
</Grid>
</Grid>
</Grid>
updated listbox in full mode updated nicklist resized still wont expand listbox
这是为 Chris W 重新更新的。这有整个代码..我的问题必须更高我真的讨厌宽度/高度/边距..
【问题讨论】:
-
删除硬性设置的高度,以及初学者列表框上的负边距.....然后在最后一个 RowDefinition 上将“auto”更改为“*”。
-
@Chris W. 感谢您的支持...自上次发布后修改后,我进行了您告诉我的更改...当窗口未最大化时,我似乎仍然无法获得完整的列表框屏幕[代码]
-
设置 VerticalContentAlignment=Stretch / VerticalAlignment=Stretch,如果不这样做,那么您的布局结构中存在更高的冲突。
-
一定是我的上层布局
-
@ChrisW.如果你可以再看一次,我添加了整个 xaml 代码..请