winform的问题

zhangjingcheng 2007-09-03 11:40:22
用show打开一个窗口的同时如何关闭前一个窗口
...全文
235 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
shenlanse0520 2007-09-04
  • 打赏
  • 举报
回复
写一个继承 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());
}
}
LQP039 2007-09-04
  • 打赏
  • 举报
回复
如果不在设计界面将属性StartPosition设置成CenterScreen的话,也可以在登陆窗体中的Actived事件中设置
sai850620 2007-09-04
  • 打赏
  • 举报
回复
把窗体的StartPostition属性设置为CenterScreen就可以了
zmj1563 2007-09-04
  • 打赏
  • 举报
回复
登陆窗口的StartPosition设为CenterScreen
LGame 2007-09-04
  • 打赏
  • 举报
回复
windowsState
zhangjingcheng 2007-09-03
  • 打赏
  • 举报
回复
可以了
就是
starform 中的 MessageBox.Show(this, "您的帐号不正确!", "错误提示");
在提示的时候显示在starform的中间??????????
在那里设置?????????
QuinsonYue 2007-09-03
  • 打赏
  • 举报
回复
怎么会不行 你是webform还是winform

如果是winform:
this.Hide();
starindex st = new starindex();
st.Show();
webform:
<a href="javascript:window.opener='null';window.close();" style="color: black">关闭窗口</a>
zhangjingcheng 2007-09-03
  • 打赏
  • 举报
回复
starlogin lg = new starlogin();
lg.Hide();
starindex st = new starindex();
st.Show();
不行啊
写在starlogin里面的
fangwancong 2007-09-03
  • 打赏
  • 举报
回复
窗体实例.Close()
wweennbb 2007-09-03
  • 打赏
  • 举报
回复
this.Hide();
隐藏就行了
zhangjingcheng 2007-09-03
  • 打赏
  • 举报
回复
说的明白点就是我现在做了个登陆窗口在执行的时候显示在显示器的最上面
我要设置的让他显示在显示器的中间!!!!!!
zhangjingcheng 2007-09-03
  • 打赏
  • 举报
回复
第2个窗口显示的时候在第1个窗口的位置
比如说第2个窗口显示在第一个窗口的中间!!!!
zhangjingcheng 2007-09-03
  • 打赏
  • 举报
回复
这个可以了我
就是说在用
FORM2 fr2 = new FORM2();
fr2.show();
打开form2的时候如何设置他在桌面的显示位置??????????
明白否?
谢谢
liu_2005_tong 2007-09-03
  • 打赏
  • 举报
回复
例如前一个窗口是FORM1后一个是FORM2
FORM2 fr2 = new FORM2();
fr2.show();
FORM1.ActiveForm.Close();
ansontang 2007-09-03
  • 打赏
  • 举报
回复
请你把问题描述清楚点
这样更容易被解决
zhangjingcheng 2007-09-03
  • 打赏
  • 举报
回复
有人吗?
郁闷啊!
peng_hai_lin 2007-09-03
  • 打赏
  • 举报
回复
Form.close()

110,526

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧