示例#1
0
        /// <summary>
        /// Form constructor
        /// Creates BindingList and binds it to the correct columns of clientsDataGrid
        /// </summary>
        public RenderClientsForm()
        {
            InitializeComponent();

            instance = this;

            clients = new BindingList <Client> ();

            clientsDataGrid.AutoGenerateColumns = false;

            clientsDataGrid.DataSource = clients;

            DataGridViewColumn column1 = new DataGridViewTextBoxColumn();

            column1.Name             = "Client Name";
            column1.DataPropertyName = "Name";
            clientsDataGrid.Columns.Add(column1);

            DataGridViewColumn column2 = new DataGridViewTextBoxColumn();

            column2.Name             = "IP Address";
            column2.DataPropertyName = "AddressString";
            clientsDataGrid.Columns.Add(column2);

            clientsDataGrid.Update();
        }
示例#2
0
        private void addRenderClientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (RenderClientsForm.instance != null)
            {
                RenderClientsForm.instance.Show();
                RenderClientsForm.instance.Activate();
                return; // only one instance of renderClientsForm can exist at the time
            }

            RenderClientsForm renderClientsForm = new RenderClientsForm();

            renderClientsForm.Show();
        }