⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gridfindform.cs

📁 《C#和.NET第一步》中的财务系统 利用三层结构做的
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HomeMoney
{
	public partial class GridFindForm : Form
	{
		private FindType findType = FindType.FDateTime;
		private string findValue = string.Empty;

		public enum FindType { FDateTime, FName, FRemark }
		public FindType Type
		{
			get { return findType; }
		}
		public string FindValue
		{
			get { return findValue; }
		}

		public GridFindForm()
		{
			InitializeComponent();
		}
		private void btnOK_Click(object sender, EventArgs e)
		{
			switch (this.cbFindItem.SelectedItem.ToString())
			{
				case "交易日期": findType = FindType.FDateTime; break;
				case "项目名称": findType = FindType.FName; break;
				case "交易说明": findType = FindType.FRemark; break;
			}
			if (findType == FindType.FDateTime)
				this.findValue = this.dtValue.Value.ToShortDateString();
			else
				this.findValue = this.txtValue.Text;

			this.Close();
		}

		private void cbFindItem_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.cbFindItem.SelectedItem.ToString() == "交易日期")
			{
				this.dtValue.Visible = true;
				this.txtValue.Visible = false;
			}
			else
			{
				this.dtValue.Visible = false;
				this.txtValue.Visible = true;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -