At the time of the execution of 'InitializeComponent', the form /is/
invisible. If you call its 'Show' or 'ShowDialog' method, its 'Visible'
property is set to 'True' automatically.
Mhm... Is the form set as startup form in the project properties?
This is the code generated by the windows application project.
As you can there is no Show or ShowDialog, yet the form is displayed.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication1
{
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.components = new System.ComponentModel.Container();
this.Size = new System.Drawing.Size(300,300);
this.Text = "Form1";
}
[STAThread]
static void Main()
{
Application.Run(new Form1());