C# 获取屏幕坐标 RT:1我想让程序第一次出现 在右上角 咋搞 貌似location没用 2咋搞一个简单的锁屏功能 用keydown 事件 如果上面有一个按钮或文本框 就没用了···是焦点问题?不要复杂的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.Left = Screen.AllScreens[0].Bounds.Width - this.Width; this.Top = Screen.AllScreens[0].Bounds.Top; } } 第一个问题:不知道你用的VS是哪个版本,不过你可以找一下StartPosition属性。它可以控制winfrom第一次出现的位置的。第二个问题:如果你只想实现屏幕锁定的话,最简单的办法是:直接把Winfrom的属性WindowState=Maximized,并且TopMost=true,在把MaximizeBox=false;基本上就可以了!~希望能帮到你!~ http://www.cnblogs.com/nuke/archive/2010/08/22/1805625.html this.StartPosition = FormStartPosition.Manual;//这里设这让Location方式生效,默认是不生效的,设了也白设。this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width, 0);//这里指定要显示的位置this.ShowInTaskbar = false;//这里把任务栏的图标去掉。 this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.Manual; this.WindowState = FormWindowState.Maximized; this.TopMost = true; this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.Manual; this.WindowState = FormWindowState.Maximized; this.TopMost = true; 1.//显示的左上角this.Left = 0;//this.Top = 0;//显示右上角this.Left = System.Windows.Forms.Screen.GetBounds(this).Width-this.Size.Width ;this.Top = 0;2.锁频事件就别用keydown事件了,焦点变了就没有了。可以用全局快捷键详情看这里:http://www.xinshoubbs.com/blog/list/b2.html this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.Manual; this.WindowState = FormWindowState.Maximized; this.TopMost = true;正解。。还有你的第二个问题。this.KeyPreview=True;就能解决窗体有控件时,不接收按键事件的问题了。 DevExpress哪个工具条可以添加自定义图片 想学一下winform皮肤开发,请问有源码可以学习吗? 关于路径问题,请知道的朋友指点一二,谢谢! 请问 easyMail 导致发送失败的原因有哪些呀 c# windows Form 间的通讯 从XP和CMMI的角度,分析下详细设计需要把没个类中的每个函数的每个参数都设计好吗? 求助关于ADO.Net中没有单字符通配符的解决方法``` 邮件发送的怪问题 急!请问各位高手,怎么用vs2005正确的运行asp格式的文件啊? 高手请进!在线等 自动生成10个整数(1~100)求解!! C#小问题
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
this.Left = Screen.AllScreens[0].Bounds.Width - this.Width;
this.Top = Screen.AllScreens[0].Bounds.Top;
}
}
第二个问题:如果你只想实现屏幕锁定的话,最简单的办法是:直接把Winfrom的属性WindowState=Maximized,并且TopMost=true,在把MaximizeBox=false;基本上就可以了!~
希望能帮到你!~
this.StartPosition = FormStartPosition.Manual;//这里设这让Location方式生效,默认是不生效的,设了也白设。
this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width, 0);//这里指定要显示的位置
this.ShowInTaskbar = false;//这里把任务栏的图标去掉。
this.FormBorderStyle = FormBorderStyle.None;
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.Manual;
this.WindowState = FormWindowState.Maximized;
this.TopMost = true;
this.FormBorderStyle = FormBorderStyle.None;
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.Manual;
this.WindowState = FormWindowState.Maximized;
this.TopMost = true;
//显示的左上角
this.Left = 0;//
this.Top = 0;
//显示右上角
this.Left = System.Windows.Forms.Screen.GetBounds(this).Width-this.Size.Width ;
this.Top = 0;2.锁频事件就别用keydown事件了,焦点变了就没有了。
可以用全局快捷键详情看这里:http://www.xinshoubbs.com/blog/list/b2.html
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.Manual;
this.WindowState = FormWindowState.Maximized;
this.TopMost = true;正解。。还有你的第二个问题。this.KeyPreview=True;就能解决窗体有控件时,不接收按键事件的问题了。