当前位置: 首页>>代码示例>>C#>>正文


C# TabPage.BringToFront方法代码示例

本文整理汇总了C#中TabPage.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# TabPage.BringToFront方法的具体用法?C# TabPage.BringToFront怎么用?C# TabPage.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TabPage的用法示例。


在下文中一共展示了TabPage.BringToFront方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildSubURLTabs

    public void BuildSubURLTabs(object sender, EventArgs ev, URLTabPlugin.TabTypes tt)
    {
        if (sender != null)
        {

            /* Create a panel, find the parent form and maximize it */
            Panel p = (Panel)sender;
            TabPage c = (TabPage)p.Parent;
            Form f = c.FindForm();
            f.WindowState = FormWindowState.Maximized;
            TabControl tc = new TabControl();
            p.Controls.Add(tc);
            tc.Dock = DockStyle.Fill;

            /* Create a list of URLTabs */

            this.propertyString = "URLTabPlugin+" + c.Text.Replace(" ", "_");

            string result = objHost.GetSQL("SELECT Value FROM properties where Name LIKE '%" + this.propertyString + "%'");

            var UTP = Activator.CreateInstance<List<URLTabPlugin>>();

            if (result != "-9999")
            {

                using (var memoryStream = new MemoryStream(Encoding.Unicode.GetBytes(result)))
                {
                    var serializer = new DataContractJsonSerializer(UTP.GetType());
                    UTP = (List<URLTabPlugin>)serializer.ReadObject(memoryStream);
                }

                foreach (URLTabPlugin utp in UTP)
                {
                    if (utp.TabType == tt)
                    {

                        TabPage tp = new TabPage(utp.TabLabel);
                        tc.Controls.Add(tp);
                        tp.Dock = DockStyle.Fill;
                        tp.BringToFront();
                        WebBrowser wb = new WebBrowser();
                        wb.AllowNavigation = true;
                        wb.AllowWebBrowserDrop = false;
                        wb.ScriptErrorsSuppressed = true;
                        wb.ScrollBarsEnabled = true;
                        wb.IsWebBrowserContextMenuEnabled = true;
                        tp.Controls.Add(wb);
                        wb.Dock = DockStyle.Fill;
                        wb.BringToFront();
                        wb.Navigate(utp.TabUrl);
                        wb.Refresh();
                    }
                }
            }
            /* Build the config tab */
            TabPage tconfig = new TabPage("Config");
            tc.Controls.Add(tconfig);
            tconfig.Dock = DockStyle.Fill;

            /* Dynamic flow layout to hold the buttons */
            FlowLayoutPanel buttonFlowLayoutPanel = new FlowLayoutPanel();
            buttonFlowLayoutPanel.BringToFront();
            buttonFlowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
            buttonFlowLayoutPanel.Location = new System.Drawing.Point(8, 10);
            buttonFlowLayoutPanel.Size = new System.Drawing.Size(510, 32);
            tconfig.Controls.Add(buttonFlowLayoutPanel);
            Button btnSaveConfig = new Button();
            btnSaveConfig.Text = "Save Config";
            btnSaveConfig.Click += new EventHandler(btnSaveConfig_Click);
            Button btnAddTab = new Button();
            btnAddTab.Text = "Add Tab";
            btnAddTab.Click += new EventHandler(btnAddTab_Click);
            buttonFlowLayoutPanel.Controls.Add(btnSaveConfig);
            buttonFlowLayoutPanel.Controls.Add(btnAddTab);

            /* Dynamic Flow Layout to hold taburlconfigs */
            dynamicFlowLayoutPanel = new FlowLayoutPanel();
            dynamicFlowLayoutPanel.BringToFront();
            dynamicFlowLayoutPanel.FlowDirection = FlowDirection.TopDown;
            dynamicFlowLayoutPanel.Location = new System.Drawing.Point(0, 40);
            dynamicFlowLayoutPanel.Size = new System.Drawing.Size(510,600);
            dynamicFlowLayoutPanel.AutoScroll = true;
            dynamicFlowLayoutPanel.WrapContents = false;
            tconfig.Controls.Add(dynamicFlowLayoutPanel);

            string results = objHost.GetSQL("SELECT Value FROM properties where Name LIKE '%" + propertyString + "%'");
            if (results != "-9999")
            {
                List<string> TabsCompleted = new List<string>();

                /* Rewrite, this doesn't make sense. Deserialize it instead and loop through those results. */
                foreach (URLTabPlugin utp in UTP)
                {
                    URLTabPluginConfigTab utpct;

                    // If the tab isn't in the list yet, create it
                    if (TabsCompleted.IndexOf(utp.TabLabel) < 0)
                    {
                        TabsCompleted.Add(utp.TabLabel);
                        utpct = new URLTabPluginConfigTab();
//.........这里部分代码省略.........
开发者ID:ManagedITStack,项目名称:labtech_URLTabPlugin,代码行数:101,代码来源:Tabs.cs


注:本文中的TabPage.BringToFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。