本身有个登陆窗体。然后比如现在有信息来了然后在右下角给弹出个提示框。想问下怎么写

解决方案 »

  1.   

    获取屏幕的分辨率,之后计算你窗体的location让他在你想显示的地方显示
      

  2.   

    http://www.crifan.com/csharp_add_tip_windows_right_coner_for_open_file_and_folder/
    这个应该可以
      

  3.   

    这个可以获取分辨率
    //这个区域不包括任务栏的Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this);
    //这个区域包括任务栏,就是屏幕显示的物理范围Rectangle ScreenArea = System.Windows.Forms.Screen.GetBounds(this);int width1 = ScreenArea.Width; //屏幕宽度 
    int height1 = ScreenArea.Height; //屏幕高度
    this.Location = new System.Drawing.Point(width1 - 窗体宽度, height1 - 窗体高度);  //指定窗体显示在右下角至于退出的时候渐隐可以采用更改透明度实现
    动态更改form的Opacity值。当然这里你必须要使用定时器timer来实现
      

  4.   

    用jquery 相关UI就可以实现了。/// <summary>
            /// EasyUI 右下角提示框
            /// </summary>
            /// <param name="msg">提示内容</param>
            public static void ShowMessage(string msg)
            {
                string scriptStr = "<script language='javascript'>$(function () { $.messager.show({ title : '提示' , msg : '@msg'}); });</script>";
                scriptStr = scriptStr.Replace("@msg", msg);
                Page p = (Page)System.Web.HttpContext.Current.Handler;
                p.ClientScript.RegisterStartupScript(p.GetType()
                , "message"
                , scriptStr);
            }
    调用
    ShowMessage("操作成功!");前提是你需要引入一个EasyUI插件和JQUEY
      

  5.   

    看错了,以为是需要类似winform的弹窗效果。 winform就更好做了。
    public class MyButton : System.Windows.Forms.Button    
    {    
        public bool Selectable    
        {    
            get { return this.GetStyle(System.Windows.Forms.ControlStyles.FixedHeight); }    
            set { this.SetStyle(System.Windows.Forms.ControlStyles.Selectable, value); }    
        }    
    }    //提示窗口代码: 
    public partial class MsgForm : Form    
    {    
        public MsgForm()    
        {    
            InitializeComponent();    
        }    
        //设置提示信息    
        public void SetMessage(string Msg)    
        {    
            lblMsg.Text = Msg;    
        }    
        private void MsgForm_Load(object sender, EventArgs e)    
        {    
            //让按钮无焦点框    
            btnOK.Selectable = false;    
            btnCancel.Selectable = false;    
        }    
        //关闭窗口    
        private void btnClose_Click(object sender, EventArgs e)    
        {    
            this.Close();    
        }    
        //给窗口画个边框    
        private void MsgForm_Paint(object sender, PaintEventArgs e)    
        {    
            Graphics grpForm=e.Graphics;    
            Pen pen = new Pen(Color.FromArgb(175, 210, 255), 1.0f);    
            grpForm.DrawRectangle(pen,0,0,this.Width-1,this.Height-1);    
        }    
    }   
    //使用提示窗口的代码: 
    private MsgForm m_frmMsg = null;            
    //提示窗口    
    //显示提示窗口    
    public void ShowLoadAlert(string Msg)    
    {    
        bool isExist = false;    
        Point pos = new Point(0, 0);    
        if (m_frmMsg != null && (!m_frmMsg.IsDisposed))    
        {    
            isExist = true;    
            pos = m_frmMsg.Location;    
        }    
        m_frmMsg = new MsgForm();    
        Rectangle r = Screen.GetWorkingArea(this);    
        //定位于右下角    
        m_frmMsg.Location = new Point(r.Right - m_frmMsg.Width, r.Bottom - m_frmMsg.Height);    
        if (isExist)    
        {    
            //如果前面有提示窗口,则将定位于其上面    
            if ((pos.Y - m_frmMsg.Height) > 0)    
                m_frmMsg.Location = new Point(r.Right - m_frmMsg.Width, pos.Y - m_frmMsg.Height);    
        }    
        m_frmMsg.SetMessage(Msg);    
        m_frmMsg.Show();    
    }   
      

  6.   

    我想你用该用System.Windows.Forms.NotifyIcon;对象
      

  7.   

    您这这短代码我直接新建个from窗体能直接复制过来用么?
      

  8.   

    这里有源码
    http://download.csdn.net/detail/wangshiwei1105/2618618
    一个窗体 一个背景图 一个按钮 一个Label
      

  9.   

    要分呀兄弟。能给我个不要分的么。或者能给我邮箱传一个么。[email protected]谢谢拜托了