就是鼠标移动到好友头像上时弹出来的那个框,不知道那位仁兄做过或是有什么思路,望讲解!谢谢!

解决方案 »

  1.   

    楼上的是说那个提示框做成一个对话框,然后永MouseMove来判断是否显示?
      

  2.   


     public partial class Form5 : Form
        {
            public Form5()
            {
                //InitializeComponent();
                this.SuspendLayout();
                // 
                // Form5
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(144, 398);
                this.Name = "Form5";
                this.Text = "Form5";
                this.Load += new System.EventHandler(this.Form5_Load);
                this.ResumeLayout(false);
            }
            Form6 f6 = new Form6();
            private void Form5_Load(object sender, EventArgs e)
            {
                f6.Show();
                f6.Hide();
                for (int i = 0; i < 5; i++)
                {
                    Button but = new Button();
                    but.Location = new Point(50, i * 100);
                    but.Size = new Size(50, 50);
                    but.Text = "文本" + i;
                    but.MouseHover += new EventHandler(but_MouseHover);
                    but.MouseLeave += new EventHandler(but_MouseLeave);
                    this.Controls.Add(but);
                }
            }        void but_MouseLeave(object sender, EventArgs e)
            {
                f6.Hide();
            }        void but_MouseHover(object sender, EventArgs e)
            {
                Button bu = sender as Button;
                int x = this.Location.X + bu.Location.X - f6.Width;
                int y = this.Location.Y + bu.Location.Y + f6.Height - bu.Height - 25;
                f6.Location = new Point(x, y);
                f6.Lable1 = bu.Text;
                f6.Show();
            }public partial class Form6 : Form
        {
            Label label1 = new Label();
            public Form6()
            {
                InitializeComponent();            label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                label1.Dock = System.Windows.Forms.DockStyle.Fill;
                this.Controls.Add(label1);
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            }        public string Lable1
            {
                set { label1.Text = value; }
            }
        }
      

  3.   


    void but_MouseHover(object sender, EventArgs e)
            {
                Button bu = sender as Button;
                int x = this.Location.X + bu.Location.X - f6.Width;
                int y = this.Location.Y + bu.Location.Y + f6.Height - bu.Height - 25;
                f6.Location = new Point(x, y);
                f6.Lable1 = bu.Text;
                f6.Show();
                this.Activate();//少了这句会使当前窗体失去焦点补上去
            }
      

  4.   

    不好意思这样Form6会出现在任务栏中在Form6的构造中加上this.ShowInTaskbar = false;