Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication11
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- AddMyGroupBox();
- }
- private void AddMyGroupBox()
- {
- // Create a GroupBox and add a TextBox to it.
- ListBox listBox1 = new ListBox();
- listBox1.BringToFront();
- listBox1.Location = new Point(330, 0);
- listBox1.Size = new Size(750, 350);
- listBox1.Items.Add("Starting to get good");
- // Set the Text and Dock properties of the GroupBox.
- // Disable the GroupBox (which disables all its child controls)
- button1.Enabled = false;
- // Add the Groupbox to the form.
- this.Controls.Add(listBox1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement