Main.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Microsoft.Win32;
using System;
using System.Windows.Forms;

namespace DrinkWaterReminder
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
            InitMenuItem();
        }

        private void Main_SizeChanged(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                this.ShowInTaskbar = false;
                notifyIcon.Visible = true;
            }
        }

        private void NotifyIcon_Click(object sender, EventArgs e)
        {
            this.Show();
            notifyIcon.Visible = false;
        }

        private void InitMenuItem()
        {
            MenuItem[] menuItems = new MenuItem[1];
            MenuItem exit = new MenuItem();
            exit.Text = "退出";
            exit.Click += new System.EventHandler(this.Exit);
            menuItems[0] = exit;
            ContextMenu contextMenu = new ContextMenu(menuItems);
            notifyIcon.ContextMenu = contextMenu;
        }

        private void Exit(object sender, System.EventArgs e)
        {
            timer.Stop();
            this.Close();
            this.Dispose(true);
        }

        private void BtnSure_Click(object sender, EventArgs e)
        {
            int interval = (int)numericUpDown.Value;
            timer.Interval = interval * 1000 * 5;
            timer.Start();
            this.Hide();
            notifyIcon.Visible = true;
        }

        private void NumericUpDown_ValueChanged(object sender, EventArgs e)
        {
            timer.Stop();
        }
后面还有 31 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。