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


C# UserControl.BringToFront方法代码示例

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


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

示例1: SetCurrentControl

 /// <summary>
 ///   Sets the current control to main window.
 /// </summary>
 /// <param name="userControl"> Current user control to be added to Main form. </param>
 public void SetCurrentControl(UserControl userControl)
 {
     bool alreadyAdded = false;
     foreach (object control in _parentContainerPanel.Controls)
     {
         if (control.Equals(userControl))
         {
             userControl.BringToFront();
             alreadyAdded = true;
         }
     }
     if (!alreadyAdded)
     {
         _parentContainerPanel.Controls.Add(userControl);
         userControl.Dock = DockStyle.Fill;
         userControl.BringToFront();
     }
     _parentContainerPanel.Refresh();
 }
开发者ID:gitter-badger,项目名称:UROCare,代码行数:23,代码来源:MainForm.cs

示例2: addUserControls

        /// <summary>
        /// 添加标签 添加内容窗体
        /// </summary>
        /// <param name="userContol">新窗体</param>
        /// <param name="memuName">标签名</param>
        /// <param name="menuId">三级菜单id</param>
        /// <param name="thisUcTag">当前窗体Tag tag包括(三级|一级| 二级 菜单的id)</param>
        /// ///  <param name="PUCName">父窗体Name</param>
        public void addUserControls(UserControl userContol, string memuName, string menuId, string thisUcTag, string PUCName)
        {
            try
            {
                if (thisUcTag != null)
                {
                    string[] strArr = thisUcTag.Split('|');
                    if (!panel_Content.Controls.ContainsKey(menuId))
                    {
                        Image myImage = null;
                        if (GlobalStaticObj.gLoginDataSet != null
                            && GlobalStaticObj.gLoginDataSet.Tables.Count > 2
                            && GlobalStaticObj.gLoginDataSet.Tables[2] != null
                            && GlobalStaticObj.gLoginDataSet.Tables[2].Rows.Count > 0)
                        {
                            DataView dv = GlobalStaticObj.gLoginDataSet.Tables[2].DefaultView;
                            dv.RowFilter = "fun_id='" + strArr[0] + "'";
                            if (dv.Count > 0)
                            {
                                DataRowView drv = dv[0];
                                if (drv["fun_img"] != DBNull.Value && drv["fun_img"].ToString().Length > 0)
                                {
                                    myImage = ServiceStationClient.Skin.SkinAssistant.GetResourcesImage(drv["fun_img"]);
                                }
                            }
                        }

                        userContol.Name = menuId;
                        userContol.Dock = DockStyle.Fill;
                        userContol.Focus();
                        panel_Content.Controls.Add(userContol);// panel_Main.Controls.Add(ucHome);                   
                        userContol.BringToFront();
                        userContol.Tag = menuId + "|" + strArr[1] + "|" + strArr[2] + "|" + PUCName;

                        childmemu(myImage, memuName, menuId, strArr[2], strArr[1], PUCName);
                    }
                    else
                    {
                        this.panel_Content.Controls.Find(menuId, false)[0].BringToFront();
                        childMemuState(menuId);
                    }
                    SYSModel.clsSysConfig.STR_CURR_TWOMEMU = strArr[2];
                }
                else
                {
                    userContol.Dock = DockStyle.Fill;
                    userContol.Focus();
                    panel_Content.Controls.Add(userContol);// panel_Main.Controls.Add(ucHome);                   
                    userContol.BringToFront();
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message);
            }
            
        }
开发者ID:caocf,项目名称:workspace-kepler,代码行数:65,代码来源:HXCMainForm.cs

示例3: addUserControls

        /// <summary>
        /// 添加标签 添加内容窗体
        /// </summary>
        /// <param name="userContol">新窗体</param>
        /// <param name="memuName">标签名</param>
        /// <param name="menuId">三级菜单id</param>
        /// <param name="thisUcTag">当前窗体Tag tag包括(三级|一级| 二级 菜单的id)</param>
        /// ///  <param name="PUCName">父窗体Name</param>
        public void addUserControls(UserControl userContol, string memuName, string menuId, string thisUcTag, string PUCName)
        {
            try
            {
                if (thisUcTag != null)
                {
                    string[] strArr = thisUcTag.Split('|');
                    if (!panel_Content.Controls.ContainsKey(menuId))
                    {
                        if (this.menus.Count >= MaxPage)
                        {
                            MessageBoxEx.ShowWarning("页签打开数量已达到最大上限,请先关闭页签!");
                            return;
                        }

                        List<string> visibleMenu = new List<string>();
                        foreach (Control ctl in panel_Content.Controls)
                        {
                            if (ctl is UserControl)
                            {
                                if (ctl.Name != menuId && ctl.Visible)
                                {
                                    visibleMenu.Add(ctl.Name);
                                }
                            }
                        }

                        Image myImage = null;
                        DataRow dr = LocalCache.GetFunction(strArr[0]);
                        if (dr != null)
                        {
                            if (dr["fun_img"].ToString().Length > 0)
                            {
                                myImage = SkinAssistant.GetResourcesImage(dr["fun_img"]);
                            }
                        }

                        userContol.Name = menuId;
                        userContol.Dock = DockStyle.Fill;
                        userContol.Focus();
                        panel_Content.Controls.Add(userContol);// panel_Main.Controls.Add(ucHome);                   
                        userContol.BringToFront();
                        userContol.Tag = menuId + "|" + strArr[1] + "|" + strArr[2] + "|" + PUCName;

                        //添加菜单
                        menus.Add(menuId, userContol.Tag.ToString());
                        this.currentMenu = menuId;

                        foreach (string menu in visibleMenu)
                        {
                            this.panel_Content.Controls[menu].Visible = false;
                        }

                        childmemu(myImage, memuName, menuId, strArr[2], strArr[1], PUCName);
                    }
                    else
                    {
                        this.currentMenu = menuId;

                        this.panel_Content.Controls.Find(menuId, false)[0].Visible = true;
                        this.panel_Content.Controls.Find(menuId, false)[0].BringToFront();
                        foreach (Control ctl in panel_Content.Controls)
                        {
                            if (ctl.Name != menuId && ctl.Visible && (ctl is UserControl))
                            {
                                ctl.Visible = false;
                            }
                        }
                        childMemuState(menuId);
                    }
                    SYSModel.clsSysConfig.STR_CURR_TWOMEMU = strArr[2];
                }
                else
                {
                    if (this.menus.Count >= MaxPage)
                    {
                        MessageBoxEx.ShowWarning("页签打开数量已达到最大上限,请先关闭页签!");
                        return;
                    }

                    userContol.Dock = DockStyle.Fill;
                    userContol.Focus();
                    panel_Content.Controls.Add(userContol);
                    userContol.BringToFront();

                    //添加菜单
                    menus.Add(menuId, memuName);
                    this.currentMenu = menuId;

                    foreach (Control ctl in panel_Content.Controls)
                    {
                        if (ctl.Name != menuId && ctl.Visible && (ctl is UserControl))
//.........这里部分代码省略.........
开发者ID:caocf,项目名称:workspace-kepler,代码行数:101,代码来源:HXCMainForm.cs

示例4: addUserControls

 /// <summary> 添加标签 添加内容窗体
 /// </summary>
 /// <param name="userContol">新窗体</param>
 /// <param name="memuName">标签名</param>
 /// <param name="menuId">三级菜单id</param>
 /// <param name="thisUcTag">当前窗体Tag tag包括(三级 |一级| 二级 菜单的id)</param>
 public void addUserControls(UserControl userContol, string memuName, string menuId, string thisUcTag, string PUCName)
 {
     try
     {
         if (thisUcTag != null)
         {
             string[] strArr = thisUcTag.Split('|');
             if (panel_Content.Controls.Find(menuId, true).Length == 0)
             {
                 userContol.Name = menuId;
                 userContol.Dock = DockStyle.Fill;
                 userContol.Focus();
                 userContol.Tag = menuId + "|" + strArr[1] + "|" + strArr[2];
                 panel_Content.Controls.Add(userContol);// panel_Main.Controls.Add(ucHome);
                 userContol.BringToFront();
                 Image myImage = null;
                 if (GlobalStaticObj.gLoginDataSet != null && GlobalStaticObj.gLoginDataSet.Tables[2] != null && GlobalStaticObj.gLoginDataSet.Tables[2].Rows.Count > 0)
                 {
                     DataView dv = GlobalStaticObj.gLoginDataSet.Tables[2].DefaultView;
                     dv.RowFilter = "fun_id='" + strArr[0] + "'";
                     if (dv.Count > 0)
                     {
                         DataRowView drv = dv[0];
                         if (drv["fun_img"] != DBNull.Value && drv["fun_img"].ToString().Trim() != "")
                         {
                             myImage = (Image)ServiceStationClient.Skin.Properties.Resources.ResourceManager.GetObject(drv["fun_img"].ToString());
                         }
                     }
                 }
                 childmemu(myImage, memuName, menuId, strArr[2], strArr[1], PUCName);
             }
             else
             {
                 panel_Content.Controls.Find(menuId, true)[0].BringToFront();
                 childMemuState(menuId);
             }
             SYSModel.clsSysConfig.STR_CURR_TWOMEMU = strArr[2];
         }
     }
     catch (Exception ex)
     {
         GlobalStaticObj_Server.GlobalLogService.WriteLog("MainForm", ex);
         MessageBoxEx.ShowWarning("程序异常");
     }
 }
开发者ID:caocf,项目名称:workspace-kepler,代码行数:51,代码来源:HXCServerMainForm.cs

示例5: TreeSectionsAfterSelect

 /// <summary>
 /// Selecting the tree node brings up the corresponding user control
 /// </summary>
 private void TreeSectionsAfterSelect(object sender, TreeViewEventArgs e)
 {
     string panelName = e.Node.Tag as string;
     if (panelName != null && _panels.ContainsKey(panelName))
     {
         if (_current != null)
             (_current as IUserSettings).Focus(false);
         _current = _panels[panelName];
         _current.BringToFront();
         (_current as IUserSettings).Focus(true);
     }
 }
开发者ID:splintor,项目名称:GitForce,代码行数:15,代码来源:FormSettings.cs

示例6: ShowControl

 private void ShowControl(UserControl control)
 {
     control.Focus();
     control.BringToFront();
     control.Dock = DockStyle.Fill;
 }
开发者ID:garciagars,项目名称:ComDriveSW,代码行数:6,代码来源:frmArea.cs

示例7: ViewControl

 private void ViewControl(UserControl control)
 {
     control.BringToFront();
 }
开发者ID:gregorypilar,项目名称:interlace,代码行数:4,代码来源:ServerForm.cs

示例8: ChangeView

        private void ChangeView(EFormView newformview)
        {
            if (CurrentFoemView == newformview) return;
            if (CurrentFoemView != EFormView.None)
            {
                if (CurrentUCView != null)
                    Controls.Remove(CurrentUCView);
            }

            UserControl newuc = null;
            IEPGView newepgview = null;

            switch (newformview)
            {
                case EFormView.None:
                    CurrentFoemView = EFormView.None;
                    return;

                case EFormView.EPG:
                    newuc = new UCEPGView();
                    newepgview = newuc as IEPGView;
                    break;

                case EFormView.EPGGrouped:
                    newuc = new UCEPGView2();
                    newepgview = newuc as IEPGView;
                    break;

                case EFormView.Scheduled:
                    newuc = new UCEPGView3();
                    newepgview = newuc as IEPGView;
                    break;

                case EFormView.EditGroups:
                    newuc = new UCEditGroups();
                    newepgview = newuc as IEPGView;
                    break;

                case EFormView.EditSources:
                    newuc = new UCSourceEditor();
                    newepgview = newuc as IEPGView;
                    break;

                case EFormView.Search:
                    newuc = new UCSearch();
                    newepgview = newuc as IEPGView;
                    break;
                case EFormView.TagedTitles:
                    newuc = new UCTagedTitles();
                    newepgview = newuc as IEPGView;
                    break;
            }

            CurrentUCView = newuc;
            CurrentEPGView = newepgview;
            Controls.Add(CurrentUCView);
            CurrentUCView.Dock = DockStyle.Fill;
            CurrentUCView.BringToFront();
            CurrentEPGView.RefreshData();
        }
开发者ID:Camel-RD,项目名称:XMLTV-EPG-Viewer,代码行数:60,代码来源:MainForm.cs

示例9: generateUserControlRacerOnFlowPanel

 // generovani vsech policek vsech hracu
 private void generateUserControlRacerOnFlowPanel(int numberOfRacers)
 {
     for (int i = 0; i < numberOfRacers; i++)
     {
         UserControl userControlForRacers = new UserControl();
         //do UserControlu nageneruje jednotlive textboxy
         userControlForRacers = setUserControlPanelForRacers(userControlForRacers);
         userControlForRacers.AutoSize = true;
         lstUserControlRacers.Add(userControlForRacers);
         // pridam UserControl do flowLayoutPanelu
         flowLayoutPanelForRacers.Controls.Add(userControlForRacers);
         userControlForRacers.BringToFront();
     }
 }
开发者ID:dedykiller,项目名称:KartTimeKeeper,代码行数:15,代码来源:Form2.cs

示例10: SetView

 private void SetView(UserControl control)
 {
     control.Parent = this.splitContainer1.Panel2;
     control.BringToFront();
     control.Dock = DockStyle.Fill;
     control.Visible = true;
     toolStripStatusMessage.Spring = true;
     toolStripStatusMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     engine1.View = control as IExplorerView;
 }
开发者ID:usbr,项目名称:Pisces,代码行数:10,代码来源:PiscesForm.cs


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