//界面公式取值 public object GetSelectValue(string sColCode) { if (tabControl.SelectedTab == null) { return(null); } TableGrid te = (TableGrid)tabControl.SelectedTab.Controls[0]; return(te.GetSelectValue(sColCode)); }
void LoadTab() { if (WindowControl == null) { return; } tabControl.TabPages.Clear(); List <CBaseObject> lstObj = WindowControl.TableInWindowControlMgr.GetList(); foreach (CBaseObject obj in lstObj) { CTableInWindowControl tiwc = (CTableInWindowControl)obj; CTable table = (CTable)Program.Ctx.TableMgr.Find(tiwc.FW_Table_id); if (table == null) { continue; } TabPage page = new TabPage(table.Name); page.Tag = tiwc; tabControl.TabPages.Add(page); CBaseObjectMgr objMgr = new CBaseObjectMgr(); objMgr.TbCode = table.Code; objMgr.Ctx = Program.Ctx; TableGrid te = new TableGrid(); te.TableInWindowControl = tiwc; te.BaseObjectMgr = objMgr; te.CaptionText = table.Name; te.ShowTitleBar = false; te.ShowToolBar = true; te.Tag = WindowControl; page.Controls.Add(te); te.Dock = DockStyle.Fill; te.BringToFront(); } }