要做一个提示信息窗口在显示器的右下角显示,让它弹出显示10秒后隐藏,隐藏时间为5分钟后再弹出,如此循环
应该怎么控制,我用的两个timer控件,每次时间不对啊
谢谢大家
应该怎么控制,我用的两个timer控件,每次时间不对啊
谢谢大家
解决方案 »
- C#链接mysql
- 求一个生成16位随机数的C#方法
- 谁有访问lotus notes数据库的类给我发一个[email protected]
- 基于Windows操作系统小型局域网络入网自动化如何实现?
- 比如租个服务器,上传一个b/s程序,然后推销这个软件(如摩托车进销存),只要交钱就给他一个密码,这样行得通吗?有人这样做过吗? (
- 求助用什么方法可以从一个网页里采集数据到另一处WEB程序提度?
- 一个抽象的属性, 应该怎么重写
- 关于在线帮助按钮的链接问题 《——菜鸟的提问
- C#调用AutoCAD 实现DWG文件转化为WMF文件,求大侠赐教,感激不尽
- △▲★■啊...啊........痛苦,我受不了了,用了.NET后,发现三天两头的怪问题,我的.NET启动不了了△▲★■
- winform DataGridView怎么让columns显示 “对象.属性”
- GoldPrinter.ExcelExpert.ExcelBase
private void Form1_Load(object sender, EventArgs e)
{
//localhost.Service web = new localhost.Service();
////web.dbcon("czq");
//=============窗体从右下角向上弹出窗口效果================ int x = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
int y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
this.Location = new Point(x, y);//设置窗体在屏幕右下角显示
if (web.yn() == "0")
{
AnimateWindow(this.Handle, 1, AW_VER_NEGATIVE | AW_SLIDE | AW_ACTIVATE);
}
//========================= DataSet dsxml = new DataSet();
dsxml.ReadXml(Directory.GetCurrentDirectory() + "\\config.xml");
xmlusername= dsxml.Tables[0].Rows[0]["username"].ToString();
string xmlpassword = dsxml.Tables[0].Rows[0]["department"].ToString();
//this.txtusername.Text ="你有"+ web.dbcon(xmlusername)+"条待办事宜";//xmlusername
if (xmlusername != "")
{
this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜," + web.assign(xmlusername) + "条转发处理";
this.button1.Enabled = false;
this.lbname.Text = web.getName(xmlusername) + ",你好";
this.panel1.Visible = false;
this.panel2.Visible = true;
}
else
{
this.panel2.Visible = false;
this.panel1.Visible = true;
}
} private void button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(Directory.GetCurrentDirectory()+"\\config.xml");
XmlNode n = doc.SelectSingleNode("/login/username");
n.InnerText =txtusername.Text;
n = doc.SelectSingleNode("/login/department");
n.InnerText =txtpwd.Text; doc.Save(Directory.GetCurrentDirectory() + "\\config.xml");
//http://219.235.110.4:8077/
//System.Diagnostics.Process.Start("http://219.235.110.4:8077/"); } private void timer1_Tick(object sender, EventArgs e)
{
//localhost.Service web = new localhost.Service();
//this.Close();
this.timer1.Enabled = true;
if (xmlusername == "")
{
xmlusername = this.txtusername.Text; }
else
{
this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜," + web.assign(xmlusername) + "条转发处理";
}
//this.txtusername.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜";//xmlusername
//=============
DataSet xmlname = new DataSet();
xmlname.ReadXml(Directory.GetCurrentDirectory() + "\\config.xml");
xmlusername = xmlname.Tables[0].Rows[0]["username"].ToString();
//============
if (xmlusername != "")
{
//this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜";
this.button1.Enabled = false;
}
if(this.timer1.Interval==5000)
{
this.Hide();
//================
this.timer2.Enabled = true;
this.timer2.Start();
//=================
}
}
private void popWin()
{
if (this.timer2.Interval ==3100)//16000
{
AnimateWindow(this.Handle, 1, AW_VER_NEGATIVE | AW_SLIDE | AW_ACTIVATE);
}
} private void timer2_Tick(object sender, EventArgs e)
{
if (web.yn() == "0")
{
if (xmlusername == "")
{
xmlusername = this.txtusername.Text; }
else
{
this.lbname.Text = web.getName(xmlusername) + ",你好";
this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜," + web.assign(xmlusername) + "条转发处理";
this.panel1.Visible = false;
this.panel2.Visible = true;
}
popWin();
//============
this.timer1.Enabled = true;
this.timer1.Start();
//============
}
} }
public partial class Form1 : Form
{
[DllImport("user32")]
private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
const int AW_HOR_POSITIVE = 0x0001;//从左到右打开窗口
const int AW_HOR_NEGATIVE = 0x0002;//从右到左打开窗口
const int AW_VER_POSITIVE = 0x0004;//从上到下打开窗口
const int AW_VER_NEGATIVE = 0x0008;//从下到上打开窗口
const int AW_CENTER = 0x0010;//看不出任何效果
const int AW_HIDE = 0x10000;//在窗体卸载时若想使用本函数就得加上此常量
const int AW_ACTIVATE = 0x20000;//在窗体通过本函数打开后,默认情况下会失去焦点,除非加上本常量
const int AW_SLIDE = 0x40000;//看不出任何效果
const int AW_BLEND = 0x80000;//淡入淡出效果 public Form1()
{
InitializeComponent();
}
string xmlusername = "";
localhost.Service web = new localhost.Service();
private void Form1_Load(object sender, EventArgs e)
{
//localhost.Service web = new localhost.Service();
////web.dbcon("czq");
//=============窗体从右下角向上弹出窗口效果================ int x = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
int y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
this.Location = new Point(x, y);//设置窗体在屏幕右下角显示
if (web.yn() == "0")
{
AnimateWindow(this.Handle, 1, AW_VER_NEGATIVE | AW_SLIDE | AW_ACTIVATE);
}
//========================= DataSet dsxml = new DataSet();
dsxml.ReadXml(Directory.GetCurrentDirectory() + "\\config.xml");
xmlusername= dsxml.Tables[0].Rows[0]["username"].ToString();
string xmlpassword = dsxml.Tables[0].Rows[0]["department"].ToString();
//this.txtusername.Text ="你有"+ web.dbcon(xmlusername)+"条待办事宜";//xmlusername
if (xmlusername != "")
{
this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜," + web.assign(xmlusername) + "条转发处理";
this.button1.Enabled = false;
this.lbname.Text = web.getName(xmlusername) + ",你好";
this.panel1.Visible = false;
this.panel2.Visible = true;
}
else
{
this.panel2.Visible = false;
this.panel1.Visible = true;
}
} private void button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(Directory.GetCurrentDirectory()+"\\config.xml");
XmlNode n = doc.SelectSingleNode("/login/username");
n.InnerText =txtusername.Text;
n = doc.SelectSingleNode("/login/department");
//n.InnerText =txtpwd.Text; doc.Save(Directory.GetCurrentDirectory() + "\\config.xml");
//http://219.235.110.4:8077/
//System.Diagnostics.Process.Start("http://219.235.110.4:8077/"); } private void timer1_Tick(object sender, EventArgs e)
{
//localhost.Service web = new localhost.Service();
//this.Close();
this.timer1.Enabled = true;
if (xmlusername == "")
{
xmlusername = this.txtusername.Text; }
else
{
this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜," + web.assign(xmlusername) + "条转发处理";
}
//this.txtusername.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜";//xmlusername
//=============
DataSet xmlname = new DataSet();
xmlname.ReadXml(Directory.GetCurrentDirectory() + "\\config.xml");
xmlusername = xmlname.Tables[0].Rows[0]["username"].ToString();
//============
if (xmlusername != "")
{
//this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜";
this.button1.Enabled = false;
}
if(this.timer1.Interval==5000)
{
this.Hide();
//================
this.timer1.Enabled = false;
this.timer2.Enabled = true;
this.timer2.Start();
//=================
}
}
private void popWin()
{
if (this.timer2.Interval == 301000)//16000
{
AnimateWindow(this.Handle, 1, AW_VER_NEGATIVE | AW_SLIDE | AW_ACTIVATE);
}
} private void timer2_Tick(object sender, EventArgs e)
{
if (web.yn() == "0")
{
if (xmlusername == "")
{
xmlusername = this.txtusername.Text; }
else
{
this.lbname.Text = web.getName(xmlusername) + ",你好";
this.lbdis.Text = "你有" + web.dbcon(xmlusername) + "条待办事宜," + web.assign(xmlusername) + "条转发处理";
this.panel1.Visible = false;
this.panel2.Visible = true;
}
popWin();
//============
this.timer2.Enabled = false;
this.timer1.Enabled = true;
this.timer1.Start();
//============
}
} }
atim.Start();
DateTime date = DateTime.Now;
atim.Elapsed += (arg, e) =>
{
if (DateTime.Now.Minute >= date.AddMinutes(5).Minute)
{
atim.Interval = 2500;
atim.Start();
date = DateTime.Now; }
};