public void onClickTableEvent(TableControl tb) { chooseTable = tb; lbNameTable.Text = tb.Table.TableName; unCheckTable(); tb.check(); updateListChoose(); }
private void flowLayoutPanel1_MouseClick(object sender, MouseEventArgs e) { if (sender is TableControl) { } else { chooseTable = null; lbNameTable.Text = "None"; unCheckTable(); } }
private void updateTable() { List <Table> list = TableController.getController().getListTable(); if (list != null) { list.ForEach(item => { TableControl tb = new TableControl(); tb.Table = item; tb.Parent = flowLayoutPanel1; flowLayoutPanel1.Controls.Add(tb); tb.onClick = new onClickTable(onClickTableEvent); tb.ContextMenuStrip = menuTable; listTable.Add(tb); }); } }
private void menuTable_Opening(object sender, CancelEventArgs e) { ContextMenuStrip menu = sender as ContextMenuStrip; TableControl tableControl = menu.SourceControl as TableControl; if (tableControl != null) { if (!tableControl.Table.TableStatus) { menuTable.Items[0].Enabled = true; menuTable.Items[1].Enabled = false; } else { menuTable.Items[0].Enabled = false; menuTable.Items[1].Enabled = true; } chooseTable = tableControl; unCheckTable(); tableControl.check(); updateListChoose(); } }