简体   繁体   中英

Java's JPanel with GridLayout equivalent in WPF's XAML

I would like declare in the XAML file a container that when I add any component to i it will behave like JPanel with GridLayout in Java. That means every component in that container will be the same size no matter I do.

You can use UniformGrid in WPF

<UniformGrid>
    <Button Content="Hello1"/>
    <Button Content="Hello2"/>
    <Button Content="Hello3"/>
    <Button Content="Hello4"/>
    <Button Content="Hello5"/>
    <Button Content="Hello6"/>
</UniformGrid>

统一网格演示

More info about UniformGrid here

http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.uniformgrid(v=vs.110).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM