Label label = new Label();
            label.BackColor = Color.Yellow;
            label.AutoSize = false;
            label.Font = new Font("Arial", 16, FontStyle.Regular);
            label.Size = new Size(60, 30);
            label.Name = "dfd";
            label.Text = "fds";
            label.TextAlign = ContentAlignment.MiddleCenter;
            label.Location = new Point(30, 40);
            this.panel1.Controls.Add(label);
this.toolTip1.SetToolTip(_这里怎么填写___ , "fsdf");

解决方案 »

  1.   

    this.toolTip1.SetToolTip(label, "fsdf");
      

  2.   

    如果 lable 这段代码放在循环中呢 ?  这个该怎么解决
      

  3.   

    for(int i=0;i<10;i++)
    {
    Label label = new Label();
      label.BackColor = Color.Yellow;
      label.AutoSize = false;
      label.Font = new Font("Arial", 16, FontStyle.Regular);
      label.Size = new Size(60, 30);
      label.Name = "dfd";
      label.Text = "fds";
      label.TextAlign = ContentAlignment.MiddleCenter;
      label.Location = new Point(30, 40 + i*40);
      this.panel1.Controls.Add(label);
    this.toolTip1.SetToolTip(label, "fsdf");
    }