RT:1我想让程序第一次出现 在右上角 咋搞 貌似location没用
   2咋搞一个简单的锁屏功能 用keydown 事件  如果上面有一个按钮或文本框 就没用了···是焦点问题?不要复杂的

解决方案 »

  1.   

     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;
               
            }
        }
      

  2.   

    第一个问题:不知道你用的VS是哪个版本,不过你可以找一下StartPosition属性。它可以控制winfrom第一次出现的位置的。
    第二个问题:如果你只想实现屏幕锁定的话,最简单的办法是:直接把Winfrom的属性WindowState=Maximized,并且TopMost=true,在把MaximizeBox=false;基本上就可以了!~
    希望能帮到你!~
      

  3.   

    http://www.cnblogs.com/nuke/archive/2010/08/22/1805625.html
      

  4.   

      
    this.StartPosition = FormStartPosition.Manual;//这里设这让Location方式生效,默认是不生效的,设了也白设。
    this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width, 0);//这里指定要显示的位置
    this.ShowInTaskbar = false;//这里把任务栏的图标去掉。
      

  5.   


                this.FormBorderStyle = FormBorderStyle.None;
                this.ShowInTaskbar = false;
                this.StartPosition = FormStartPosition.Manual;
                this.WindowState = FormWindowState.Maximized;
                this.TopMost = true;
      

  6.   


                this.FormBorderStyle = FormBorderStyle.None;
                this.ShowInTaskbar = false;
                this.StartPosition = FormStartPosition.Manual;
                this.WindowState = FormWindowState.Maximized;
                this.TopMost = true;
      

  7.   

    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
      

  8.   

    this.FormBorderStyle = FormBorderStyle.None;
      this.ShowInTaskbar = false;
      this.StartPosition = FormStartPosition.Manual;
      this.WindowState = FormWindowState.Maximized;
      this.TopMost = true;正解。。还有你的第二个问题。this.KeyPreview=True;就能解决窗体有控件时,不接收按键事件的问题了。