您的位置:程序门 -> .net技术 -> c#



弹出form的位置 为什么会不一样?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


弹出form的位置 为什么会不一样?[已结贴,结贴人:jaj114]
发表于:2007-02-11 23:15:11 楼主
using   system;
using   system.collections.generic;
using   system.componentmodel;
using   system.data;
using   system.drawing;
using   system.text;
using   system.windows.forms;

namespace   windowsapplication1
{
        public   partial   class   form1   :   form
        {
                public   form1()
                {
                        initializecomponent();
                }

                private   void   button1_click(object   sender,   eventargs   e)
                {
                        form2   f2   =   new   form2();
                        f2.location   =   this.location;
                        f2.show();
                }
        }
}
发表于:2007-02-11 23:19:071楼 得分:0
其实我是想   把一个窗口根据屏幕光标的位置来定位   查阅了很多的资料   都没有好的解决办法
真的是好郁闷   谁有好的解决办法   麻烦帮助一下   谢谢
发表于:2007-02-11 23:33:502楼 得分:20
f2.startposition   =   formstartposition.manual;
                        point   nl   =   new   point(3,   4);   //坐标可以自己定
                        f2.location   =   nl;
发表于:2007-02-11 23:34:453楼 得分:0
呵呵,去屏幕光标位置应该会吧?不会再开贴问吧。
发表于:2007-02-11 23:39:144楼 得分:0
完全正确!
发表于:2007-02-12 07:43:285楼 得分:0
up


快速检索

最新资讯
热门点击