您的位置:首页 > 编程语言 > C#

c# windowsmobile开发技巧

2009-06-21 11:47 393 查看
(1)如何构造全屏窗体


this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = FormBorderStyle.None;
this.ControlBox = false;
this.Menu = null;


(2)如何将一个窗体放在屏幕中央?

要显示一个非全屏窗体,请确保窗体的 FormBorderStyle 属性设置为 FormBorderStyle.None。要使窗体位于中央,请将以下代码添加到窗体的 FormLoad 事件处理程序中:将 FormBorderStyle 设置为 FormBorderStyle.None,然后

Rectangle screen = Screen.PrimaryScreen.Bounds;

this.Location = new Point((screen.Width - this.Width) / 2,

  (screen.Height - this.Height ) / 2);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: