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;会产生错误!
C#初学总结
最新推荐文章于 2023-04-27 10:59:03 发布