欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

C#怎样才能实现窗体最小化到托盘呢?

程序员文章站 2022-06-08 22:30:10
private void form1_resize(object sender, system.eventargs e)&...
private void form1_resize(object sender, system.eventargs e) {
    if (this.windowstate == formwindowstate.minimized) {
        this.visible = false;
        this.notifyicon1.visible = true;
    }
}

private void notifyicon1_click(object sender, system.eventargs e) {
    this.visible = true;
    this.windowstate = formwindowstate.normal;
    this.notifyicon1.visible = false;
}