一文详解C# Chart控件

  using System;

  using System.Collections.Generic;

  using System.ComponentModel;

  using System.Data;

  using System.Drawing;

  using System.Linq;

  using System.Text;

  using System.Threading.Tasks;

  using System.Windows.Forms;

  namespace 实现提示操作

  {

  public partial class Form1 : Form

  {

  public Form1()

  {

  InitializeComponent();

  }

  private void toolTip1_Popup(object sender, PopupEventArgs e)

  {

  ToolTip tool = (ToolTip)sender;

  if(e.AssociatedControl.Name == "textBox1")//e代表我们要触发的事件,我们是在textBox1触发

  {

  tool.ToolTipTitle = "提示信息";//修改标题

  tool.ToolTipIcon = ToolTipIcon.Info;//修改图标

  }

  else

  {

  tool.ToolTipTitle = "警告信息";

  tool.ToolTipIcon = ToolTipIcon.Warning;

  }

  }

  }

  }