如何在IDM等表单的标题栏中添加按钮 [英] how to add a button in title bar of a form like IDM

查看:117
本文介绍了如何在IDM等表单的标题栏中添加按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要隐藏我使用此代码隐藏的表单,

  private   void  notifyIcon1_MouseDoubleClick( object  sender,MouseEventArgs e)
{
.Show();
this .WindowState = FormWindowState.Normal;
}


如果(FormWindowState.Minimized == this .WindowState)
{
notifyIcon1.Visible = true ;
notifyIcon1.ShowBalloonTip( 1 );
this .Hide();
}
else if (FormWindowState.Normal == this .WindowState)
{
notifyIcon1.Visible = false ;
}





但我想在标题栏中添加一个按钮,如互联网下载管理器,它隐藏表格并修复它在系统托盘中,如果点击最小化,它将只是最小化,这里我的最小化按钮强制应用程序转到系统托盘

我怎么能像IDM一样实现IDM

解决方案

从中获取参考:

轻松自定义标题栏 [ ^ ]


尝试使用这些引用在标题栏上添加自定义按钮。

添加一个最小化到托盘按钮 [ ^ ]

draw-custom-buttons-on-windows-vista-7-aero-titlebar [ ^ ]

how-to-添加一个额外的按钮到窗口标题栏 - 所以它将作为标准工作 [ ^ ]

i want to hide the form i have used this code for hiding,

private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            this.Show();
            this.WindowState = FormWindowState.Normal;
        }


if (FormWindowState.Minimized == this.WindowState)
           {
               notifyIcon1.Visible = true;
               notifyIcon1.ShowBalloonTip(1);
               this.Hide();
           }
           else if (FormWindowState.Normal == this.WindowState)
           {
               notifyIcon1.Visible = false;
           }



but i want to add a button in the title bar like internet download manager which hides the form and fix it in the system tray, and if minimize is clicked it will just be minimize, here my minimize button force the app to go to system tray
how can i achive that IDM like feature

解决方案

Take a reference from it :
Easy Customize Title Bar[^]


Try these References to add a Custom button on Title Bar.
Adding-a-Minimize-to-tray-button[^]
draw-custom-buttons-on-windows-vista-7-aero-titlebar[^]
how-to-add-an-extra-button-to-the-window-title-bar-so-it-will-be-work-as-standa[^]


这篇关于如何在IDM等表单的标题栏中添加按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆