下面的代码,显示hello时,主窗体还没显示出来.我想让主窗口显示完整后,再显示hello。请专家指点
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication34
{
public class Form1 : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(636, 468);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
MessageBox.Show("hello");
}
}
}
问题点数:20、回复次数:4Top
1 楼qwersky(爱睡觉的小虫)回复于 2006-02-07 14:58:28 得分 0
不知道你想搞什么 你要是想在窗体出来后,再显示"hello"的话,你还不如在form里再放一个button,点button再显示hello.Top
2 楼sky1940(114981-sky)回复于 2006-02-07 16:15:42 得分 20
在你的Form1_Load里加this.Show()能实现
private void Form1_Load(object sender, System.EventArgs e)
{
this.Show();
MessageBox.Show("hello");
}
Top
3 楼luoboqingcai(萝卜青菜)回复于 2006-02-07 17:52:03 得分 0
this.Show();
Thread.Sleep(1000);
MessageBox.Show("aaa");
Top
4 楼ttrice(天天米饭)回复于 2006-02-07 17:59:09 得分 0
思路:
在Load事件中添加一个timer控件,然后自己控制延时,显示窗口Top




