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


C# Form.BringToFront方法代码示例

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


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

示例1: ShowForm

 public static void ShowForm(Form form, bool show)
 {
     if (form.InvokeRequired)
     {
         form.BeginInvoke(new Action(() =>
         {
             if (show)
             {
                 form.Show();
                 form.BringToFront();
                 form.WindowState = FormWindowState.Normal;
             }
             else
             {
                 form.Hide();
                 form.WindowState = FormWindowState.Minimized;
             }
         }));
     }
     else
     {
         if (show)
         {
             form.Show();
             form.BringToFront();
             form.WindowState = FormWindowState.Normal;
         }
         else
         {
             form.Hide();
             form.WindowState = FormWindowState.Minimized;
         }
     }
 }
开发者ID:peterwillcn,项目名称:Avalon-nano,代码行数:34,代码来源:SafeControlUpdater.cs

示例2: Show

        /// <summary>
        /// Draws a MessageBox that always stays on top with a title, selectable buttons and an icon
        /// </summary>
        static public DialogResult Show(string message, string title,
            MessageBoxButtons buttons,MessageBoxIcon icon)
        {
            // Create a host form that is a TopMost window which will be the 

            // parent of the MessageBox.

            Form topmostForm = new Form();
            // We do not want anyone to see this window so position it off the 

            // visible screen and make it as small as possible

            topmostForm.Size = new System.Drawing.Size(1, 1);
            topmostForm.StartPosition = FormStartPosition.Manual;
            System.Drawing.Rectangle rect = SystemInformation.VirtualScreen;
            topmostForm.Location = new System.Drawing.Point(rect.Bottom + 10,
                rect.Right + 10);
            topmostForm.Show();
            // Make this form the active form and make it TopMost

            topmostForm.Focus();
            topmostForm.BringToFront();
            topmostForm.TopMost = true;
            // Finally show the MessageBox with the form just created as its owner

            DialogResult result = MessageBox.Show(topmostForm, message, title,
                buttons,icon);
            topmostForm.Dispose(); // clean it up all the way


            return result;
        }
开发者ID:matalangilbert,项目名称:stromohab-2008,代码行数:35,代码来源:TopMostMessageBox.cs

示例3: Scan

        public Scan(Program.Options options)
        {
            log.Debug("creating scan host");

            log.DebugFormat("create interprocess input pipe (handle={0})", options.pipeIn);
            pipeIn = new AnonymousPipeClientStream(PipeDirection.In, options.pipeIn);

            log.DebugFormat("create interprocess output pipe (handle={0})", options.pipeOut);
            pipeOut = new AnonymousPipeClientStream(PipeDirection.Out, options.pipeOut);

            log.Debug("create sync event");
            sync = new ManualResetEvent(false);

            log.Debug("create native messaging port");
            port = new Port(pipeIn, pipeOut);

            log.Debug("create stop event");
            stop = new ManualResetEvent(false);

            log.Debug("create form");
            form = new Form();
            form.TopMost = true;
            form.BringToFront();

            log.Debug("create hook");
            hook = new WinFormsWindowMessageHook(form);

            log.Debug("create image acquired and image transferred events");
            imageAcquired = new ManualResetEvent(false);
            imageTransferred = new ManualResetEvent(false);

            log.Debug("scan host created");
        }
开发者ID:duckfly-tw,项目名称:Chrome4Net,代码行数:33,代码来源:Scan.cs

示例4: set_window

        public void set_window(Form frm)
        {
            foreach (Control control in panel_container.Controls)
            {
                if (control.Text == frm.Text)
                {
                    control.BringToFront();
                    current_form = (Form)frm;
                    frm.Dispose();
                    return;
                }
            }

            frm.TopLevel = false;
            frm.Dock = System.Windows.Forms.DockStyle.Fill;
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.TopMost = true;
            this.panel_container.Controls.Add(frm);
            frm.Show();
            frm.BringToFront();
            current_form = (Form)frm;

            TreeNode node = new TreeNode();
            node.Text = frm.Text;
            tree_menu.Nodes.Add(node);
        }
开发者ID:topomondher,项目名称:web_helper,代码行数:26,代码来源:frm_main.cs

示例5: InstanceFormChild

        public static void InstanceFormChild(Form frmChild, Form frmParent, bool modal)
        {
            if (frmParent != null)
                foreach (var item in frmParent.MdiChildren)
                {
                    if (item.GetType() == frmChild.GetType())
                    {
                        frmChild.Focus();
                        frmChild.BringToFront();
                        frmChild.Activate();
                        return;
                    }
                }

            frmChild.ShowInTaskbar = false;

            if (modal)
            {
                frmChild.TopLevel = true;
                frmChild.ShowDialog();
            }
            else
            {
                if (frmParent != null)
                    frmChild.MdiParent = frmParent;

                frmChild.Show();
            }
        }
开发者ID:tonfranco,项目名称:LR,代码行数:29,代码来源:FormUtil.cs

示例6: bringToFront

        // [focus]
        /// <summary>
        /// bring form to foreground </summary>
        public static void bringToFront(Form form)
        {
            Program.log.write("bringToFront");
            Tick.timer(500, (t, args) =>
            {
                if (t is Timer)
                {
                    Timer timer = t as Timer;

                    Program.log.write("bringToFront: tick");
                    timer.Enabled = false;

                    //diagram bring to top hack in windows
                    if (form.WindowState == FormWindowState.Minimized)
                    {
                        form.WindowState = FormWindowState.Normal;
                    }

            #if !MONO
                    SetForegroundWindow(form.Handle.ToInt32());
            #endif
                    form.TopMost = true;
                    form.Focus();
                    form.BringToFront();
                    form.TopMost = false;
                    form.Activate();
                }
            });
        }
开发者ID:pekand,项目名称:infinite-diagram,代码行数:32,代码来源:Media.cs

示例7: SettForm

 public void SettForm(Form frm)
 {
     frm.TopLevel = false;
     frm.Visible = true;
     panelMENU.Controls.Add(frm);
     panelMENU.Controls[frm.Name].Focus();
     frm.BringToFront();
 }
开发者ID:rhizalpatrax64bit,项目名称:logistic-management-system,代码行数:8,代码来源:FormRETAIL.cs

示例8: BringToFront

 public static void BringToFront(Form form)
 {
     // Make this form the active form
     form.TopMost = true;
     form.Focus();
     form.BringToFront();
     form.TopMost = false;
 }
开发者ID:MartyIX,项目名称:SoTh,代码行数:8,代码来源:BringToFront.cs

示例9: FormClosingCheck

        public static DialogResult FormClosingCheck(Form frmName)
        {
            if (frmName.WindowState == System.Windows.Forms.FormWindowState.Minimized)
            {
                frmName.WindowState = FormWindowState.Normal;
            }

            frmName.BringToFront();

            // Ask user what to do with the changes
            return MessageBox.Show(CultureSupport.TextDictionary("MS_DATACHANGED", TextReturnTypeEnum.PureString), frmName.Text, MessageBoxButtons.YesNoCancel);
        }
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:12,代码来源:FormSupport.cs

示例10: displayFormOnPanel

 public static void displayFormOnPanel(Control.ControlCollection control, Form newForm)
 {
     bool isExist = control.Contains(newForm);
     if (isExist == false)
     {
         newForm.TopLevel = false;    //设置为非顶级窗体
         newForm.FormBorderStyle = FormBorderStyle.None;       //设置窗体为非边框样式
         newForm.Dock = System.Windows.Forms.DockStyle.Fill;   //设置样式是否填充整个PANEL
         control.Add(newForm);      //添加窗体
         newForm.Show();
     }
     newForm.BringToFront();
 }
开发者ID:qq5013,项目名称:KryptonAccessController,代码行数:13,代码来源:WidgetThread.cs

示例11: FixFormFields

 private static void FixFormFields(Form form, Label label, TextBox textBox, Button buttonOk, Button buttonCancel)
 {
     form.ClientSize = new Size(396, 107);
     form.Controls.AddRange(new Control[] {label, textBox, buttonOk, buttonCancel});
     form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
     form.FormBorderStyle = FormBorderStyle.FixedDialog;
     form.StartPosition = FormStartPosition.CenterScreen;
     form.MinimizeBox = false;
     form.MaximizeBox = false;
     form.AcceptButton = buttonOk;
     form.CancelButton = buttonCancel;
     form.BringToFront();
 }
开发者ID:Vipeax,项目名称:GW2WinMan,代码行数:13,代码来源:InputBox.cs

示例12: ActivateForm

        public override void ActivateForm(Form form, DesktopWindow window, IntPtr hwnd)
        {
            if (window == null || window.Handle != form.Handle)
            {
                Log.InfoFormat("[{0}] Activating Main Window - current=({1})", hwnd, window != null ? window.Exe : "?");

                form.BringToFront();
                form.Focus();
                form.Show();
                form.Activate();

                // stop flashing...happens occassionally when switching quickly when activate manuver is fails
                NativeMethods.FlashWindow(form.Handle, NativeMethods.FLASHW_STOP);
            }
        }
开发者ID:mesenger,项目名称:superputty,代码行数:15,代码来源:WindowActivator.cs

示例13: Show

 public static DialogResult Show(string message, string title, MessageBoxButtons buttons)
 {
     Form topmostForm = new Form();
     topmostForm.Size = new System.Drawing.Size(1, 1);
     topmostForm.StartPosition = FormStartPosition.Manual;
     System.Drawing.Rectangle rect = SystemInformation.VirtualScreen;
     topmostForm.Location = new System.Drawing.Point(rect.Bottom + 10, rect.Right + 10);
     topmostForm.Show();
     topmostForm.Focus();
     topmostForm.BringToFront();
     topmostForm.TopMost = true;
     DialogResult result = MessageBox.Show(topmostForm, message, title, buttons);
     topmostForm.Dispose();
     return result;
 }
开发者ID:benhejl,项目名称:SWENG500_Team1,代码行数:15,代码来源:TopMostMessageBox.cs

示例14: AbrirEnContainerNewForm

        public static void AbrirEnContainerNewForm(Form frmNueva,Panel pnlContenedor)
        {
            Herramientas.frmContAnterior = Herramientas.frmContActual;
            Herramientas.frmContActual = frmNueva;

            if (frmContAnterior != null)
            {
                frmContAnterior.Close();
                frmContAnterior.Dispose();
            }

            frmContActual.TopLevel = false;
            pnlContenedor.Controls.Add(frmContActual);
            frmContActual.Show();
            frmContActual.BringToFront();
        }
开发者ID:razor777,项目名称:Bencaleth,代码行数:16,代码来源:Herramientas.cs

示例15: smethod_1

 // Token: 0x06002EFA RID: 12026
 // RVA: 0x00130E14 File Offset: 0x0012F014
 public static DialogResult smethod_1(string string_0, string string_1, MessageBoxButtons messageBoxButtons_0, MessageBoxIcon messageBoxIcon_0, MessageBoxDefaultButton messageBoxDefaultButton_0)
 {
     SplashScreen.smethod_3();
     Form form = new Form();
     form.ShowInTaskbar = false;
     form.Size = new Size(1, 1);
     form.StartPosition = FormStartPosition.Manual;
     Rectangle virtualScreen = SystemInformation.VirtualScreen;
     form.Location = new Point(virtualScreen.Bottom + 10, virtualScreen.Right + 10);
     form.Show();
     form.Focus();
     form.BringToFront();
     form.TopMost = true;
     DialogResult result = MessageBox.Show(form, string_0, string_1, messageBoxButtons_0, messageBoxIcon_0);
     form.Dispose();
     return result;
 }
开发者ID:newchild,项目名称:Project-DayZero,代码行数:19,代码来源:Class792.cs


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