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



winform的问题


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


winform的问题[已结贴,结贴人:zhangjingcheng]
发表于:2007-09-03 11:40:22 楼主
用show打开一个窗口的同时如何关闭前一个窗口
发表于:2007-09-03 11:44:301楼 得分:2
this.hide();
隐藏就行了
发表于:2007-09-03 11:44:422楼 得分:2
窗体实例.close()
发表于:2007-09-03 12:00:503楼 得分:0
starlogin   lg   =   new   starlogin();
                                                                lg.hide();
                                                                starindex   st   =   new   starindex();
                                                                st.show();
不行啊
    写在starlogin里面的
发表于:2007-09-03 12:08:074楼 得分:2
怎么会不行   你是webform还是winform

如果是winform:
                                                                this.hide();
                                                                starindex   st   =   new   starindex();
                                                                st.show();
webform:
<a   href= "javascript:window.opener= 'null ';window.close(); "   style= "color:   black "> 关闭窗口 </a>
发表于:2007-09-03 12:49:225楼 得分:0
可以了
    就是
      starform   中的   messagebox.show(this,   "您的帐号不正确! ",   "错误提示 ");
在提示的时候显示在starform的中间??????????
    在那里设置?????????
发表于:2007-09-03 13:00:476楼 得分:2
form.close()
发表于:2007-09-03 15:08:027楼 得分:0
有人吗?
    郁闷啊!
发表于:2007-09-03 15:48:178楼 得分:2
请你把问题描述清楚点
    这样更容易被解决
发表于:2007-09-03 15:56:119楼 得分:2
例如前一个窗口是form1后一个是form2
form2   fr2   =   new   form2();
fr2.show();
form1.activeform.close();
发表于:2007-09-03 16:45:2110楼 得分:0
这个可以了我
      就是说在用
form2   fr2   =   new   form2();
fr2.show();
打开form2的时候如何设置他在桌面的显示位置??????????
    明白否?
谢谢
发表于:2007-09-03 16:47:1311楼 得分:0
第2个窗口显示的时候在第1个窗口的位置
    比如说第2个窗口显示在第一个窗口的中间!!!!
发表于:2007-09-03 16:49:0412楼 得分:0
说的明白点就是我现在做了个登陆窗口在执行的时候显示在显示器的最上面
    我要设置的让他显示在显示器的中间!!!!!!
发表于:2007-09-04 11:40:3613楼 得分:2
写一个继承   applicationcontext   的类   像这样就解决关闭启动窗体的问题了  
static   class   program
        {
                public   class   myapplicationcontext   :   applicationcontext
                {
                        public   myapplicationcontext()
                        {
                                frmsystemlogin   frmstart   =   new   frmsystemlogin();
                                frmstart.show();
                        }
                        private   void   onapplicationexit(object   sender,   eventargs   e)
                        {
                        }
                        private   void   onformclosing(object   sender,   eventargs   e)
                        {
                        }
                        private   void   onformclosed(object   sender,   eventargs   e)
                        {
                        }
                }

                ///   <summary>
                ///   应用程序的主入口点。
                ///   </summary>
                [stathread]
                static   void   main()
                {
                        application.run(new   myapplicationcontext());
                }
        }
发表于:2007-09-04 13:30:1614楼 得分:0
windowsstate
发表于:2007-09-04 13:31:2415楼 得分:2
登陆窗口的startposition设为centerscreen
发表于:2007-09-04 13:36:1316楼 得分:2
把窗体的startpostition属性设置为centerscreen就可以了
发表于:2007-09-04 13:40:5817楼 得分:2
如果不在设计界面将属性startposition设置成centerscreen的话,也可以在登陆窗体中的actived事件中设置


快速检索

最新资讯
热门点击