C#初学总结

来源:互联网 发布:微信误删恢复软件 编辑:程序博客网 时间:2024/06/01 12:57
DateTime t1 = Convert.ToDateTime("1999-8-9");DateTime t2 = Convert.ToDateTime("2007-8-19");TimeSpan ts = t2 - t1;int d = ts.Days;d就是间隔的天数--------------------------------------------------------------------------------------Point formPoint = this.Location;//获取窗体的屏幕坐标Point mousePoint = Control.MousePosition;//获取鼠标光标的坐标e.Button == MouseButtons.Left;//判断点击的是左键-------------------------------------------------------------------------------------- 
//1、在屏幕的右下角显示窗体
//这个区域不包括任务栏的
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 - 窗体高度);  //指定窗体显示在右下角
//2、在母窗体的中间显示子窗体的位置计算
waitForm.Location = new Point((this.Location.X + (this.Width - waitForm.Width) / 2),                                                (this.Location.Y + (this.Height - waitForm.Height) / 2));---------------------------------------------------------------------------------------------设置:FormBorderStyle:FixedDialog可以隐藏窗口图标并固定窗口大小!给空间删除事件,比如:onMouseDown的事情,只需(控件.MouseDown -= 函数;)增加事件同理 GenerateMember:false;会产生错误!
 
原创粉丝点击