UIPanel panel = new UIPanel(); panel.Location = new Point(50, 50); panel.Size = new Size(200, 200); panel.BackColor = Color.Gray; this.Controls.Add(panel);
UIPanel panel = new UIPanel(); panel.Dock = DockStyle.Fill; panel.AutoScroll = true; this.Controls.Add(panel); Button button = new Button(); button.Text = "Test"; button.Location = new Point(50, 50); panel.Controls.Add(button);This code creates a UIPanel control that fills the entire form and has automatic scrolling enabled. It then adds a button control to the panel. The UIPanel control is part of the System.Windows.Forms namespace in the .NET Framework library.