msg.WindowPos.x:=(screen.Width-form1.Width) div 2;
msg.WindowPos.y:=(screen.Height-form1.Height) div 2;

解决方案 »

  1.   

    呵呵,要用整形的呀msg.WindowPos.x:=(screen.Width-form1.Width) div 2;
    msg.WindowPos.y:=(screen.Height-form1.Height) div 2;
      

  2.   

    sigh,呵呵,我问了别人取证是不是用/,那个人说是
    气死我了
    但是还有问题是,如果我的form比较的长,定位就非常的不准确了,怎么办?
    当from比较短的时候,定位还可以
      

  3.   

    msg.WindowPos.x:=Round((screen.Width-form1.Width)/2);
    msg.WindowPos.y:=Round((screen.Height-form1.Height)/2);
      

  4.   

    为什么form长了,就不行了呢?我测试了取的值也是对的
      

  5.   

    用Position:=poScreenCenter就可以了。
      

  6.   

    getwindowpos
    setwindowos  使用像素作单位吧!
    解决你的所有烦恼
      

  7.   

    错了
    setwindowpos=====================================================\\\\\\\\\\
    api我的最爱
      

  8.   

    getwindowpos?
    具体怎么用
    我说了,我用的程序和用Position:=poScreenCenter冲突了