1
我正在使用WPF和DevExpress。我想在停靠面板中添加兩個按鈕。正如我添加第二個按鈕它說:Content is set more than once
。爲什麼這樣?我犯了什麼錯誤,或者碼頭面板不允許這樣做。如何在停靠面板中添加兩個或更多按鈕?
<dxdo:DockLayoutManager Margin="0,-3,-156,0" HorizontalAlignment="Right" VerticalAlignment="Top" Background="White" Height="243" Width="109">
<dxdo:LayoutGroup Caption="LayoutRoot" Margin="0,0,0,172">
<dxdo:LayoutGroup Orientation="Vertical">
<dxdo:LayoutPanel x:Name="Panel1" ShowCloseButton="False" ShowMaximizeButton="False" ShowPinButton="False" ShowRestoreButton="False" ShowControlBox="False" AllowDock="False" AllowDrag="False" AllowFloat="False" AllowHide="False" AllowClose="False" AllowActivate="False" AllowMinimize="False" AllowMaximize="False">
<Button x:Name="ToggleButton1" Content="New" Click="ToggleButton_Click" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Button Content="Delete Focused Row"
Click="DeleteButton_Click33"
Grid.Column="1" />
</dxdo:LayoutPanel>
<dxdo:LayoutPanel x:Name="Panel2" ShowCloseButton="False" ShowMaximizeButton="False" ShowPinButton="False" ShowRestoreButton="False" ShowControlBox="False" AllowDock="False" AllowDrag="False" AllowFloat="False" AllowHide="False" AllowClose="False" AllowActivate="False" AllowMinimize="False" AllowMaximize="False">
<Button x:Name="ToggleButton2" Content="Close" Click="ToggleButton2_Click" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</dxdo:LayoutPanel>
</dxdo:LayoutGroup>
</dxdo:LayoutGroup>
</dxdo:DockLayoutManager>
我怎樣才能把它們放在同一行? –
@AnnieSheikh使用水平堆疊面板或任何適合您需求的其他面板...或參考我已鏈接的示例。或者甚至將DevExpress [LayoutControl](http://help.devexpress.com/#WPF/CustomDocument8147)放置在面板內容中,並通過LayoutControl功能排列所有按鈕。 – DmitryG
謝謝DmitryG :) –