首页 > 其他分享 >WPF DockPanel

WPF DockPanel

时间:2024-08-30 17:36:34浏览次数:3  
标签:WPF Bottom DockPanel Top left

<Window x:Class="WpfApp313.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp313"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <DockPanel>
        <Button DockPanel.Dock="Left" Background="red">1 (left)</Button>
        <Button DockPanel.Dock="Left" Background="Brown">2 (left)</Button>
        <Button DockPanel.Dock="Left" Background="Yellow">3 (left)</Button>
        <Button DockPanel.Dock="Right" Background="Blue">4 (Top)</Button>
        <Button DockPanel.Dock="Top" Background="Cyan">5 (Top)</Button>
        <Button DockPanel.Dock="Bottom" Background="Pink">6 (Bottom)</Button>
        <Button DockPanel.Dock="Bottom" Background="Wheat">7 (Bottom)</Button>
        <Button Background="Gray">8</Button>
    </DockPanel>
</Window>

 

 

 

 

标签:WPF,Bottom,DockPanel,Top,left
From: https://www.cnblogs.com/Fred1987/p/18389201

相关文章

  • WPF automatically generate shapes fill wrappanel
    //customizecontrol//xaml<UserControlx:Class="WpfApp309.RectTbk"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"......
  • WPF-Prism中View和ViewModel的关联
    1、在MainWindow.xaml中进行Prism命名空间的引入以及ViewModelLocator.AutoWireViewModel属性的设置需要注意,AutoWireViewModel默认就是为True,表示自动关联ViewModel,因此这个命名空间引入以及设置属性的步骤是可以省略的2、通过ViewModelLocator进行View与ViewModel层的自动关......
  • [WPF]数据绑定时为何会出现StringFormat失效2T
    在数据绑定过程中,我们经常会使用StringFormat对要显示的数据进行格式化,以便获得更为直观的展示效果,但在某些情况下格式化操作并未生效,例如Button的Content属性以及ToolTip属性绑定数据进行StringFormat时是无效的。首先回顾一下StringFormat的基本用法。StringFormat的用法Str......
  • WPF automatically fill WrapPanel
    //xaml<Windowx:Class="WpfApp309.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi......
  • [WPF]数据绑定时为何会出现StringFormat失效VPqCe7cCvg7iTH0g
    在数据绑定过程中,我们经常会使用StringFormat对要显示的数据进行格式化,以便获得更为直观的展示效果,但在某些情况下格式化操作并未生效,例如Button的Content属性以及ToolTip属性绑定数据进行StringFormat时是无效的。首先回顾一下StringFormat的基本用法。StringFormat的用法Str......
  • WPF mouse down on canvas and draw shapes which render with random colors
    //customcontrol//xaml<UserControlx:Class="WpfApp307.ElpTbk"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"......
  • WPF ItemsControl IsItemsHost true
    //customziecontrol//xaml<UserControlx:Class="WpfApp306.ElpTbk"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"......
  • [WPF]数据绑定时为何会出现StringFormat失效
    在数据绑定过程中,我们经常会使用StringFormat对要显示的数据进行格式化,以便获得更为直观的展示效果,但在某些情况下格式化操作并未生效,例如Button的Content属性以及ToolTip属性绑定数据进行StringFormat时是无效的。首先回顾一下StringFormat的基本用法。StringFormat的用法Str......
  • [WPF]数据绑定时为何会出现StringFormat失效
    在数据绑定过程中,我们经常会使用StringFormat对要显示的数据进行格式化,以便获得更为直观的展示效果,但在某些情况下格式化操作并未生效,例如Button的Content属性以及ToolTip属性绑定数据进行StringFormat时是无效的。首先回顾一下StringFormat的基本用法。StringFormat的用法Str......
  • 「对比评测」标准WPF DataGrid与DevExpress WPF GridControl有何不同?(二)
    DevExpressWPF拥有120+个控件和库,将帮助您交付满足甚至超出企业需求的高性能业务应用程序。通过DevExpressWPF能创建有着强大互动功能的XAML基础应用程序,这些应用程序专注于当代客户的需求和构建未来新一代支持触摸的解决方案。无论是Office办公软件的衍伸产品,还是以数据为中心......