Пример #1
0
        public MyTabControl Create(int beginline, int endline, string[] lines)
        {
            MyTabControl o   = new MyTabControl();
            string       key = "Begin TabDlg.SSTab ";

            o.General = VBtoNET.PopulateGeneral(key, lines, beginline, endline);
            // tab pages
            int tabPageNum = Int16.Parse(VBtoNET.GetProperty("Tabs", beginline, endline, lines));


            for (int i = 0; i < tabPageNum; i++)
            {
                MyTabpage page = new MyTabpage();

                page.General = new General();

                page.General.Name            = o.General.Name + "TabPage" + i.ToString();
                page.General.Text            = VBtoNET.GetProperty("TabCaption(" + i.ToString() + ")", beginline, endline, lines);
                page.Padding                 = 3;
                page.General.Tabindex        = i.ToString();
                page.UseVisualStyleBackColor = true;
                // these needs to be fixed a bit, i'm not sure what the size and location should be
                page.General.Locationx = "4";
                page.General.Locationy = "22";
                int sizex = Int16.Parse(o.General.Sizex) - 8;
                int sizey = Int16.Parse(o.General.Sizey) - 26;
                page.General.Sizex = sizex.ToString();
                page.General.Sizey = sizey.ToString();
                o.tabList.Add(page);
            }

            o.ControlNameMap = PopulateControlNamesList(beginline, endline, lines, o.tabList);

            return(o);
        }
Пример #2
0
        public MyTabControl Create(int beginline, int endline, string[] lines)
        {
            MyTabControl o   = new MyTabControl();
            string       key = "Begin TabDlg.SSTab ";

            o.General = VBtoNET.PopulateGeneral(key, lines, beginline, endline);
            // tab pages
            string tabPageNumStr = VBtoNET.GetProperty("Tabs", beginline, endline, lines);
            int    tabPageCount  = 0;

            if (tabPageNumStr == "")
            {
                bool foundTab = true;
                // can't find the tabs property
                for (int tabnum = 0; tabnum < 20; tabnum++)
                {
                    if (!foundTab)
                    {
                        break;
                    }
                    for (int i = beginline; i < endline; i++)
                    {
                        string s = lines[i];
                        if (s.Contains("Tab(" + tabnum.ToString()))
                        {
                            tabPageCount++;
                            break;
                        }
                        if (i == endline - 1)
                        {
                            foundTab = false;
                            break;
                        }
                    }
                }
            }
            else
            {
                tabPageCount = Int16.Parse(tabPageNumStr);
            }


            for (int i = 0; i < tabPageCount; i++)
            {
                MyTabpage page = new MyTabpage();

                page.General = new General();

                page.General.Name            = o.General.Name + "TabPage" + i.ToString();
                page.General.Text            = VBtoNET.GetProperty("TabCaption(" + i.ToString() + ")", beginline, endline, lines);
                page.Padding                 = 3;
                page.General.Tabindex        = i.ToString();
                page.UseVisualStyleBackColor = true;
                // these needs to be fixed a bit, i'm not sure what the size and location should be
                page.General.Locationx = "4";
                page.General.Locationy = "22";
                int sizex = Int16.Parse(o.General.Sizex) - 8;
                int sizey = Int16.Parse(o.General.Sizey) - 26;
                page.General.Sizex = sizex.ToString();
                page.General.Sizey = sizey.ToString();
                o.tabList.Add(page);
            }

            o.ControlNameMap = PopulateControlNamesList(beginline, endline, lines, o.tabList);

            return(o);
        }