hi,
I think you still not understand the layout of the WPF, you should spend much time on reading the document or books :)
And I share you the code that you want, hope it help you:
System.Windows.Controls.Primitives.StatusBar statusBar = new System.Windows.Controls.Primitives.StatusBar(); System.Windows.Controls.DockPanel myDockPanel = new System.Windows.Controls.DockPanel() { LastChildFill = true }; statusBar.SetValue(System.Windows.Controls.DockPanel.DockProperty, System.Windows.Controls.Dock.Bottom); System.Windows.Controls.Button buttonOK = new System.Windows.Controls.Button(); buttonOK.Content = "Generate Output"; buttonOK.Margin = new System.Windows.Thickness(0, 0, 0, 0); statusBar.Items.Add(buttonOK); myDockPanel.Children.Add(statusBar); System.Windows.Controls.Canvas canvas = new System.Windows.Controls.Canvas(); myDockPanel.Children.Add(canvas);this.elementHost.Child = myDockPanel;
Best day, Best life