I am trying to dynamically create a window with a indeterminate progress bar in it. I can create a Grid panel and the progress bar. Then I add the progress bar as a child of the Grid panel. I just don'
t know how to add the Grid panel as a child of the Window.
Experts Can You Help???
Here is what I have so far:
private void btn_Click(object sender, RoutedEventArgs e)
Window window = new Window();
window.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
window.WindowStyle = System.Windows.WindowStyle.None;
window.ResizeMode = System.Windows.ResizeMode.NoResize;
window.Height = 50;
window.Width = 150;
window.Background = Brushes.AliceBlue;
Grid grid = new Grid();
// *** add grid as child to window *** //
ProgressBar pb = new ProgressBar();
pb.IsIndeterminate = true;
pb.Height = 30;
pb.Width = 150;
pb.Name = "pb";