A stack overflow is occurring in the auto-generated code for my winform. It happens only at the start of the auto-generated code for the form, not any of the controls in it. I tried removing the first line, and it happened on the next one. There is no stack trace or inner exception, please help.
EDIT
Here is my code for the form:
namespace Eternal_Continent
{
public partial class Almanac : Form
{
public Almanac()
{
InitializeComponent();
}
public List<string> Content = new List<string>();
private void Almanac_Load(object sender, EventArgs e)
{
timer1.Interval = 5000;
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(Application.StartupPath + "\\Resources\\font_name.ttf");
textBox1.Font = new Font(pfc.Families[0], 36);
}
private void Almanac_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
Hide();
}
}
}
And here is the designer's:
namespace Eternal_Continent
{
partial class Almanac
{
/// <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.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Almanac));
this.textBox1 = new System.Windows.Forms.TextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.Color.Khaki;
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(546, 582);
this.textBox1.TabIndex = 0;
//
// timer1
//
this.timer1.Enabled = true;
//
// Almanac
// I removed the autoscale lines here, because I wanted to see if it would still create errors, it did
this.BackgroundImage = Properties.Resources.Stone;
this.ClientSize = new System.Drawing.Size(546, 582);
this.Controls.Add(this.textBox1);
this.Icon = Properties.Textures.EternalContinent1;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Almanac";
this.Text = "Almanac";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Almanac_FormClosing);
this.Load += new System.EventHandler(this.Almanac_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.Dispose();
}
#endregion
private System.Windows.Forms.Timer timer1;
public System.Windows.Forms.TextBox textBox1;
}
}
EDIT #2 Removing the Dispose() line causes
The current process has used all of its system allowance of handles for Window Manager objects
in my Resources.Designer.cs.