コード例 #1
0
 public EditTable_Assistant_Form(usrc_myGroupBox mygrpbox, SQLTable tbl,ID_v id_v, DBTableControl xDBTables,int xpos, int ypos)
 {
     my_start_up_id_v = id_v;
     m_xpos = xpos;
     m_ypos = ypos;
     m_DBTables = xDBTables;
     m_MyGroupBox = mygrpbox;
     m_tbl = tbl;
     InitializeComponent();
     btn_Cancel.Text = lngRPM.s_Cancel.s;
     this.Text = tbl.lngTableName.s + " (" + tbl.TableName + ")";
     string csError="";
     FillDataTable(ref csError);
 }
コード例 #2
0
        public void RepositionInputControls(usrc_myGroupBox pmyGroupBox, ref MySize size, int Level)
        {
            int LeftMarginGroupBox = 7;
            int RightMarginGroupBox = 7;
            int TopMarginGroupBox = 10;
            int StartTopMarginGroupBox = 40;
            int BottomMarginGroupBox = 2;

            int LeftMarginInputBox = 3;
            int RightMarginInputBox = 3;
            int TopMarginInputBox = 40;
            int BottomMarginInputBox = 4;

            int cxMax = 0;

            int x = 0;
            int y = 0;

            if (Level >= ColorList.Count)
            {
                Level = ColorList.Count - 1;
            }
            pmyGroupBox.BackColor = ColorList[Level];
            if (pmyGroupBox.bExpanded)
            {
                foreach (MyControl ctrl in pmyGroupBox.controls)
                {

                    if (ctrl.Control.GetType() == typeof(usrc_myGroupBox))
                    {
                        usrc_myGroupBox pGrpBox = (usrc_myGroupBox)ctrl.Control;
                        MySize xsize = new MySize();
                        if (y == 0)
                        {
                            y = y + StartTopMarginGroupBox;
                        }
                        else
                        {
                            y = y + TopMarginGroupBox;
                        }
                        pGrpBox.Top = y;
                        pGrpBox.Left = LeftMarginGroupBox;
                        pGrpBox.Visible = true;

                        RepositionInputControls(pGrpBox, ref xsize, Level + 1);

                        y = y + xsize.cy;

                        pGrpBox.Width = xsize.cx;
                        pGrpBox.Height = xsize.cy;

                        if (cxMax < pGrpBox.Width)
                        {
                            cxMax = pGrpBox.Width;
                        }

                    }
                    else if (ctrl.Control.GetType() == typeof(usrc_InputControl))
                    {

                        usrc_InputControl pInputControl = (usrc_InputControl)ctrl.Control;

                        x = LeftMarginInputBox; // ColPosition[iCount % iColumns];

                        pInputControl.Left = x;

                        if (cxMax < (x + pInputControl.Width + RightMarginInputBox))
                        {
                            cxMax = (x + pInputControl.Width + RightMarginInputBox);
                        }

                        y = y + TopMarginInputBox;
                        pInputControl.Top = y;
                        pInputControl.Show();
                        TopMarginInputBox = 8;
                        y = y + pInputControl.Height + BottomMarginInputBox;
                    }
                    else
                    {
                        MessageBox.Show("Program Error in RepositionInputControls(MyGroupBox pmyGroupBox)");
                    }
                    //iCount++;
                }
                size.cx = LeftMarginGroupBox + cxMax + RightMarginGroupBox;
                size.cy = y + BottomMarginGroupBox;
            }
            else
            {
                foreach (MyControl ctrl in pmyGroupBox.controls)
                {

                    if (ctrl.Control.GetType() == typeof(usrc_myGroupBox))
                    {
                        usrc_myGroupBox pGrpBox = (usrc_myGroupBox)ctrl.Control;
                        pGrpBox.Visible = false;
                    }
                    else if (ctrl.Control.GetType() == typeof(usrc_InputControl))
                    {

                        usrc_InputControl pInputControl = (usrc_InputControl)ctrl.Control;
                        pInputControl.Hide();

                    }
                    else
                    {
                        MessageBox.Show("Program Error in RepositionInputControls(MyGroupBox pmyGroupBox)");
                    }
                    //iCount++;
                }
                pmyGroupBox.Height = 38;
                size.cx = pmyGroupBox.Width;
                size.cy = pmyGroupBox.Height;
            }
        }
コード例 #3
0
 public void myGroupBox_usrc_myGroupBox_IndexChanged(SQLTable tbl,usrc_myGroupBox xmyGroupBox)
 {
     if (pParentTable != null)
     {
         pParentTable.myGroupBox.SetEvent_IndexChanged(tbl, xmyGroupBox);
         this.myGroupBox.Changed_up = AtLeastOneInputControlChanged();
     }
     else
     {
         this.myGroupBox.Changed_up = AtLeastOneInputControlChanged();
     }
 }