您的位置:首页 > 编程语言 > C#

C#开发右下角显示图片的应用程序

2017-11-23 01:05 253 查看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {    
        public Form1()
        {
            InitializeComponent();
            timer1.Start();
            this.notifyIcon1.Visible = true;//在通知区显示Form的Icon
            this.WindowState = FormWindowState.Minimized;  //不显示窗体
            this.Visible = false;
            this.ShowInTaskbar = false;//使Form不在任务栏上显示 
//具体可以参照图片           
        }
        int a = 0;
        private void timer1_Tick(object sender, EventArgs e)
        {
            a =a + 1;
            MessageBox.Show(a.ToString());
        }          
    }
}



右下角显示图标



右键点击图标执行
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("无用");

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c#