一个什么都没有的窗体BaseDialogTest partial class BaseDialogTest {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
} #region Windows Form Designer generated code /// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.SuspendLayout();
// 
// BaseDialogTest
// 
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(634, 448);
this.ControlBox = false;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Name = "BaseDialogTest";
this.Text = "BaseDialogTest";
this.ResumeLayout(false); } #endregion } public partial class BaseDialogTest : Form {
public BaseDialogTest() {
InitializeComponent();
this.Load += new EventHandler(BaseDialogTest_Load);
} void BaseDialogTest_Load(object sender, EventArgs e) {
this.Text = "";
}
}然后用ShowDialog方法显示,就显示不出来Using(BaseDialogTest dlg = new BaseDialogTest()){
dlg.ShowDialog();
}