怎么做 像QQ 和51 那样的上线提醒的 右边冒出来的小窗口  
那个冒出来的小窗口  该怎么写代码....   
最好有点 代码提示  
谢谢了   

解决方案 »

  1.   

    下面是我一个程序上用的一个弹出对话框,在右下角慢慢弹出,我屏蔽了消失的函数,你也可以加上,因为是从我程序上直接复制的,所以代码里面可能会有点无关的函数,你用不到,看看方法好了,肯定管用 
    /// <summary>
        /// 警告闪烁对话框
        /// </summary>
        public partial class WarningInfoPromptDlg : Form
        {
            /// <summary>
            /// API函数,闪烁窗口用
            /// </summary>
            /// <param name="handle">
            /// 闪烁的控件句柄
            /// </param>
            /// <param name="bInvert">
            /// 是否闪烁
            /// </param>
            /// <returns></returns>
            [System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
            public static extern bool FlashWindow(IntPtr handle, bool bInvert);
            //
            private int heightMax;
            /// <summary>
            /// 高度最大值
            /// </summary>
            public int HeightMax
            {
                get { return heightMax; }
                set { heightMax = value; }
            }
            private int widthMax;
            /// <summary>
            /// 宽度最大值
            /// </summary>
            public int WidthMax
            {
                get { return widthMax; }
                set { widthMax = value; }
            }
            private int equipNo = 0;
            /// <summary>
            /// 装置号
            /// </summary>
            public int EquipNo
            {
                get { return equipNo; }
                set { equipNo = value; }
            }
            private DateTime dt = new DateTime();
            /// <summary>
            /// 报警发生时间
            /// </summary>
            public DateTime Dt
            {
                get { return dt; }
                set { dt = value; }
            }
            private string message = "";
            /// <summary>
            /// 报警信息
            /// </summary>
            public string Message
            {
                get { return message; }
                set { message = value; }
            }
            private bool useAlertSound = true;
            /// <summary>
            /// 是否使用报警音
            /// </summary>
            public bool UseAlertSound
            {
                get { return useAlertSound; }
                set { useAlertSound = value; }
            }
            public WarningInfoPromptDlg()
            {
                InitializeComponent();
            }        private void WarningInfoPromptDlg_Load(object sender, EventArgs e)
            {
                Screen[] screens = Screen.AllScreens;
                Screen screen = screens[0];//获取屏幕变量
                this.Location = new Point(screen.WorkingArea.Width - widthMax - 5, screen.WorkingArea.Height - 34);//WorkingArea为Windows桌面的工作区
                if (useAlertSound)
                {
                    timer3.Enabled = true;
                }
            }
            /// <summary>
            /// 滚动显示窗口
            /// </summary>
            public void ScrollShow()
            {
                this.Width = widthMax;
                this.Height = 0;
                labelEquipNo.Text = string.Format("{0:D}号装置", equipNo);
                labelTime.Text = dt.ToString("T");
                richTextBox1.Text = message;
                this.Show();
                this.timer1.Enabled = true;
            }
            //滚动上升窗口
            private void ScrollUp()
            {
                if (this.Height < heightMax)
                {
                    this.Height += 3;
                    this.Location = new Point(this.Location.X, this.Location.Y - 3);
                }
                else
                {
                    //滚动上升定时器
                    this.timer1.Enabled = false;
                    //闪烁定时器
                    this.timer2.Enabled = true;
                }
            }
            //滚动下降窗口
            private void ScrollDown()
            {
                if (Height > 3)
                {
                    this.Height -= 3;
                    this.Location = new Point(this.Location.X, this.Location.Y + 3);
                }
                else
                {
                    this.timer2.Enabled = false;
                    this.Close();
                }
            }        private void timer1_Tick(object sender, EventArgs e)
            {
                ScrollUp();
            }        private void timer2_Tick(object sender, EventArgs e)
            {
                //ScrollDown();
                FlashWindow(this.Handle, true);
            }
            //报警声音
            private void timer3_Tick(object sender, EventArgs e)
            {
                Console.Beep(0X23F, 500); 
            }
        }
      

  2.   


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace WindowsApplication9
    {
        public partial class Form1 : Form
        {
            private int heightMax = 0;        public Form1()
            {
                InitializeComponent();
                this.Load += new EventHandler(FrmMessage_Load);
                this.timer1.Tick += new EventHandler(timer1_Tick);
            }        private void FrmMessage_Load(object sender, System.EventArgs e)
            {
                ScrollShow(200, 200);
            }
            public void ScrollShow(int height,int width)
            {
                Screen screen = Screen.AllScreens[0];//获取屏幕变量
                this.Location = new Point(screen.WorkingArea.Width - width, screen.WorkingArea.Height - 34);
                this.heightMax = height;
                this.Width = width;
                this.Height = 0;
                this.timer1.Enabled = true;
            }        private void ScrollUp()
            {
                if (Height < heightMax)
                {
                    this.Height += 3;
                    this.Location = new Point(this.Location.X, this.Location.Y - 3);
                }
                else
                {
                    this.timer1.Enabled = false;
                }
            }        private void timer1_Tick(object sender, System.EventArgs e)
            {
                ScrollUp();
            }
        }
    }
      

  3.   

     private void button2_Click(object sender, System.EventArgs e)
       {
        Thread receivex = new Thread(new ThreadStart(this.showwiindow));
        receivex.Start();
        Thread.Sleep(6000);
       }
      delegate void showwiindowHandler();
      private void showwiindow()
      {
       if (this.InvokeRequired)
       {
        showwiindowHandler si = new showwiindowHandler(this.showwiindow);
        this.BeginInvoke(si, new object[0]);
        return;      
       }
       Message form=new Message();
       form.HeightMax=120;
       form.WidthMax=148;
       form.ScrollShow();
      }参考
    参考
      

  4.   

    解决方案:
    其实就是一个FORM ,开始显示在任务栏下,触发后,一个timer 不停将这个FORM 向上移动。DOTNETBAR 中有写好的控件可以使用~~~