如何使窗口位置在不同分辨率下都能居中?该调用哪些api?窗口弹出就居中 显示。  我知道 C#属性里 有 StartPosition.  因为用的自定义控件,所以调用不了 系统属性。 用win32 api 的 用做到?  
跪求C#代码。  高分悬赏!!!!

解决方案 »

  1.   

    一样的问题??
    http://www.3s8.cn/develop/cyuyan/200705/1387.html     看的眼花缭乱
      

  2.   

    把你自己写的那个继承Window不行吗?
      

  3.   

    http://topic.csdn.net/u/20101012/16/9249dd51-51e7-4e4a-8a03-bcca81f0e30f.html?39062我在另一个贴已经回答了
      

  4.   


    using System.Windows.Forms;   
    //获取屏幕分辨率   
    int SH = Screen.PrimaryScreen.Bounds.Height;   
    int SW = Screen.PrimaryScreen.Bounds.Width;   
    //获取窗口居中Top和Left   
    int thisH=100;   
    int thisW=200;   
    int SH = (Screen.PrimaryScreen.Bounds.Height - 30 - thisH) / 2;   
    int SW = (Screen.PrimaryScreen.Bounds.Width - 10 - thisW) / 2;
      

  5.   

    http://topic.csdn.net/u/20101012/16/9249dd51-51e7-4e4a-8a03-bcca81f0e30f.html?39062
    可以去看看